]> git.tdb.fi Git - libs/gl.git/blobdiff - source/program.cpp
Check and report the use of legacy built-in variables in a program
[libs/gl.git] / source / program.cpp
index 111cf64b1d31886e3d33cf831d89c01642a18a6e..ffdd3b6380e03180a6e3790ea730d57fcd6d8832 100644 (file)
@@ -94,6 +94,7 @@ void Program::link()
                        (*i)->compile();
 
        uniforms.clear();
+       legacy_vars = false;
 
        glLinkProgram(id);
        int value;
@@ -127,6 +128,20 @@ void Program::link()
                        info.type = type;
                        uniforms_by_index[i] = &info;
                }
+               else
+                       legacy_vars = true;
+       }
+
+       glGetProgramiv(id, GL_ACTIVE_ATTRIBUTES, &count);
+       for(int i=0; i<count; ++i)
+       {
+               char name[128];
+               int len = 0;
+               int size;
+               GLenum type;
+               glGetActiveAttrib(id, i, sizeof(name), &len, &size, &type, name);
+               if(len && !strncmp(name, "gl_", 3))
+                       legacy_vars = true;
        }
 
        if(ARB_uniform_buffer_object)