]> git.cworth.org Git - apitrace/commitdiff
Don't generate fake glBindAttribLocation for built-in attributes.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 26 May 2011 19:54:29 +0000 (20:54 +0100)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 26 May 2011 19:54:29 +0000 (20:54 +0100)
gltrace.py

index 47be12afa7015473ebd76dc8e31d04950c122980..811480079ed7a9a1de7fc3a608460166ab4b09f2 100644 (file)
@@ -387,10 +387,12 @@ class GlTracer(Tracer):
             print '        GLchar name[256];'
             # TODO: Use ACTIVE_ATTRIBUTE_MAX_LENGTH instead of 256
             print '        __glGetActiveAttrib(program, attrib, sizeof name, NULL, &size, &type, name);'
-            print '        GLint location = __glGetAttribLocation(program, name);'
-            print '        if (location >= 0) {'
+            print "        if (name[0] != 'g' || name[1] != 'l' || name[2] != '_') {"
+            print '            GLint location = __glGetAttribLocation(program, name);'
+            print '            if (location >= 0) {'
             bind_function = glapi.glapi.get_function_by_name('glBindAttribLocation')
             self.fake_call(bind_function, ['program', 'location', 'name'])
+            print '            }'
             print '        }'
             print '    }'
         if function.name == 'glLinkProgramARB':
@@ -403,10 +405,12 @@ class GlTracer(Tracer):
             print '        GLcharARB name[256];'
             # TODO: Use ACTIVE_ATTRIBUTE_MAX_LENGTH instead of 256
             print '        __glGetActiveAttribARB(programObj, attrib, sizeof name, NULL, &size, &type, name);'
-            print '        GLint location = __glGetAttribLocationARB(programObj, name);'
-            print '        if (location >= 0) {'
+            print "        if (name[0] != 'g' || name[1] != 'l' || name[2] != '_') {"
+            print '            GLint location = __glGetAttribLocationARB(programObj, name);'
+            print '            if (location >= 0) {'
             bind_function = glapi.glapi.get_function_by_name('glBindAttribLocationARB')
             self.fake_call(bind_function, ['programObj', 'location', 'name'])
+            print '            }'
             print '        }'
             print '    }'