|
|
@@ -145,7 +145,7 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte
|
|
|
|
|
|
if (cgGetParameterBaseResource(p) == CG_ATTR0) {
|
|
|
// The Cg toolkit claims that it is bound to a generic vertex attribute.
|
|
|
- if (_glsl_program != 0) {
|
|
|
+ if (_glgsg->has_fixed_function_pipeline() && _glsl_program != 0) {
|
|
|
// This is where the Cg glslv compiler lies, making the stupid
|
|
|
// assumption that we're using an NVIDIA card where generic attributes
|
|
|
// are aliased with conventional vertex attributes. Instead, it
|
|
|
@@ -246,7 +246,7 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte
|
|
|
// A conventional texture coordinate set.
|
|
|
loc = CA_texcoord + cgGetParameterResourceIndex(p);
|
|
|
|
|
|
- } else {
|
|
|
+ } else if (_glgsg->has_fixed_function_pipeline()) {
|
|
|
// Some other conventional vertex attribute.
|
|
|
switch (res) {
|
|
|
case CG_POSITION0:
|
|
|
@@ -276,6 +276,14 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte
|
|
|
GLCAT.error(false) << ".\n";
|
|
|
loc = CA_unknown;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ GLCAT.error()
|
|
|
+ << "Cg varying " << cgGetParameterName(p);
|
|
|
+ if (cgGetParameterSemantic(p)) {
|
|
|
+ GLCAT.error(false) << " : " << cgGetParameterSemantic(p);
|
|
|
+ }
|
|
|
+ GLCAT.error(false) << " is bound to a conventional vertex attribute, "
|
|
|
+ "but the compatibility profile is not enabled.\n";
|
|
|
}
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
@@ -916,8 +924,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) {
|
|
|
} else {
|
|
|
// There is no vertex column with this name; disable the attribute
|
|
|
// array.
|
|
|
-#ifdef SUPPORT_FIXED_FUNCTION
|
|
|
- if (p == 0) {
|
|
|
+ if (_glgsg->has_fixed_function_pipeline() && p == 0) {
|
|
|
// NOTE: if we disable attribute 0 in compatibility profile, the
|
|
|
// object will disappear. In GLSL we fix this by forcing the vertex
|
|
|
// column to be at 0, but we don't have control over that with Cg.
|
|
|
@@ -930,9 +937,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) {
|
|
|
_glgsg->_glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0);
|
|
|
}
|
|
|
|
|
|
- } else
|
|
|
-#endif // SUPPORT_FIXED_FUNCTION
|
|
|
- if (p >= 0) {
|
|
|
+ } else if (p >= 0) {
|
|
|
_glgsg->disable_vertex_attrib_array(p);
|
|
|
|
|
|
if (p == _color_attrib_index) {
|