]> git.cworth.org Git - apitrace/commitdiff
glstate: Skip GL_COMPRESSED_TEXTURE_FORMATS when GL_NUM_COMPRESSED_TEXTURE_FORMATS...
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 10 Jun 2013 06:17:55 +0000 (07:17 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 10 Jun 2013 06:17:55 +0000 (07:17 +0100)
Should fix issue #144.

retrace/glstate_params.py

index 54e0c673e22b822356fe18b2ed63eeef0a0ec439..c5cddb9cd725fbfc95a7d1b752664afc6cebcb25 100644 (file)
@@ -173,7 +173,9 @@ class StateGetter(Visitor):
             print '    %s *%s = _allocator.alloc<%s>(%s + 1);' % (elem_type, temp_name, elem_type, array_length)
         print '    memset(%s, 0, %s * sizeof *%s);' % (temp_name, array_length, temp_name)
         print '    %s[%s] = (%s)0xdeadc0de;' % (temp_name, array_length, elem_type)
-        print '    %s(%s, %s);' % (inflection + self.suffix, ', '.join(args), temp_name)
+        print '    if (%s) {' % array_length
+        print '        %s(%s, %s);' % (inflection + self.suffix, ', '.join(args), temp_name)
+        print '    }'
         # Simple buffer overflow detection
         print '    assert(%s[%s] == (%s)0xdeadc0de);' % (temp_name, array_length, elem_type)
         return temp_name