print
print 'static inline struct buffer_mapping *'
print 'get_buffer_mapping(GLenum target) {'
- print ' switch(target) {'
+ print ' switch (target) {'
for target in self.buffer_targets:
print ' case GL_%s:' % target
print ' return & __%s_mapping;' % target.lower()
print '}'
print
- # Generate memcpy's signature
- self.trace_function_decl(glapi.memcpy)
-
# Generate a helper function to determine whether a parameter name
# refers to a symbolic value or not
print 'static bool'
print 'is_symbolic_pname(GLenum pname) {'
- print ' switch(pname) {'
+ print ' switch (pname) {'
for function, type, count, name in glparams.parameters:
if type is glapi.GLenum:
print ' case %s:' % name
# Generate a helper function to know how many elements a parameter has
print 'static size_t'
print '__gl_param_size(GLenum pname) {'
- print ' switch(pname) {'
+ print ' switch (pname) {'
for function, type, count, name in glparams.parameters:
if type is not None:
print ' case %s: return %u;' % (name, count)
self.emit_memcpy('mapping->map', 'mapping->map', 'mapping->length')
print ' }'
if function.name in ('glFlushMappedBufferRange', 'glFlushMappedBufferRangeAPPLE'):
- # TODO: avoid copying [0, offset] bytes
print ' struct buffer_mapping *mapping = get_buffer_mapping(target);'
print ' if (mapping) {'
if function.name.endswith('APPLE'):
print ' GLsizeiptr length = size;'
print ' mapping->explicit_flush = true;'
print ' //assert(offset + length <= mapping->length);'
- self.emit_memcpy('mapping->map', 'mapping->map', 'offset + length')
+ self.emit_memcpy('(char *)mapping->map + offset', '(const char *)mapping->map + offset', 'length')
print ' }'
# FIXME: glFlushMappedNamedBufferRangeEXT
Tracer.dispatch_function(self, function)
def emit_memcpy(self, dest, src, length):
- print ' unsigned __call = Trace::localWriter.beginEnter(&__memcpy_sig);'
+ print ' unsigned __call = Trace::localWriter.beginEnter(&Trace::memcpy_sig);'
print ' Trace::localWriter.beginArg(0);'
print ' Trace::localWriter.writeOpaque(%s);' % dest
print ' Trace::localWriter.endArg();'
binding_name = 'GL_%s_ARRAY_BUFFER_BINDING' % uppercase_name
function = api.get_function_by_name(function_name)
- print ' // %s' % function.name
+ print ' // %s' % function.prototype()
self.array_trace_prolog(api, uppercase_name)
self.array_prolog(api, uppercase_name)
print ' if (__glIsEnabled(%s)) {' % enable_name
else:
SUFFIX = suffix
function_name = 'glVertexAttribPointer' + suffix
- print ' // %s' % function_name
+ function = api.get_function_by_name(function_name)
+
+ print ' // %s' % function.prototype()
print ' if (__vertex_attrib == VERTEX_ATTRIB%s) {' % SUFFIX
if suffix == 'NV':
print ' GLint __max_vertex_attribs = 16;'
print ' __glGetVertexAttribiv%s(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING%s, &__binding);' % (suffix, SUFFIX)
print ' if (!__binding) {'
- function = api.get_function_by_name(function_name)
-
# Get the arguments via glGet*
for arg in function.args[1:]:
if suffix == 'NV':