print ' switch (pname) {'
for function, type, count, name in glparams.parameters:
if type is not None:
- print ' case %s: return %u;' % (name, count)
- print ' case GL_COMPRESSED_TEXTURE_FORMATS: {'
- print ' GLint num_compressed_texture_formats = 0;'
- print ' _glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &num_compressed_texture_formats);'
- print ' return num_compressed_texture_formats;'
- print ' }'
+ print ' case %s: return %s;' % (name, count)
print ' default:'
print r' os::log("apitrace: warning: %s: unknown GLenum 0x%04X\n", __FUNCTION__, pname);'
print ' return 1;'
])
def serializeArgValue(self, function, arg):
- if function.name in self.draw_function_names and arg.name == 'indices':
- print ' GLint _element_array_buffer = 0;'
- print ' _glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &_element_array_buffer);'
- print ' if (!_element_array_buffer) {'
- if isinstance(arg.type, stdapi.Array):
- print ' trace::localWriter.beginArray(%s);' % arg.type.length
- print ' for(GLsizei i = 0; i < %s; ++i) {' % arg.type.length
- print ' trace::localWriter.beginElement();'
- print ' trace::localWriter.writeBlob(%s[i], count[i]*_gl_type_size(type));' % (arg.name)
- print ' trace::localWriter.endElement();'
- print ' }'
- print ' trace::localWriter.endArray();'
- else:
- print ' trace::localWriter.writeBlob(%s, count*_gl_type_size(type));' % (arg.name)
- print ' } else {'
- Tracer.serializeArgValue(self, function, arg)
- print ' }'
- return
-
# Recognize offsets instead of blobs when a PBO is bound
if function.name in self.unpack_function_names \
and (isinstance(arg.type, stdapi.Blob) \