def header(self, api):
Tracer.header(self, api)
+ print '#include "gltrace.hpp"'
+ print
print '// Whether user arrays were used'
print 'static bool __user_arrays = false;'
print 'static bool __user_arrays_arb = false;'
print '};'
print
print 'static vertex_attrib __get_vertex_attrib(void) {'
- print ' if (__user_arrays_arb) {'
+ print ' if (__user_arrays_arb || __user_arrays_nv) {'
print ' GLboolean __vertex_program = GL_FALSE;'
print ' __glGetBooleanv(GL_VERTEX_PROGRAM_ARB, &__vertex_program);'
print ' if (__vertex_program) {'
Tracer.trace_function_impl_body(self, function)
+ gremedy_functions = [
+ 'glStringMarkerGREMEDY',
+ 'glFrameTerminatorGREMEDY',
+ ]
+
def dispatch_function(self, function):
if function.name in ('glLinkProgram', 'glLinkProgramARB'):
# These functions have been dispatched already
return
+ # We implement the GREMEDY extensions, not the driver
+ if function.name in self.gremedy_functions:
+ return
+
+ if function.name in ('glXGetProcAddress', 'glXGetProcAddressARB', 'wglGetProcAddress'):
+ if_ = 'if'
+ for gremedy_function in self.gremedy_functions:
+ print ' %s (strcmp("%s", (const char *)%s) == 0) {' % (if_, gremedy_function, function.args[0].name)
+ print ' __result = (%s)&%s;' % (function.type, gremedy_function)
+ print ' }'
+ if_ = 'else if'
+ print ' else {'
+ Tracer.dispatch_function(self, function)
+ print ' }'
+ return
+
Tracer.dispatch_function(self, function)
def emit_memcpy(self, dest, src, length):
def wrap_ret(self, function, instance):
Tracer.wrap_ret(self, function, instance)
+
+ if function.name == 'glGetString':
+ print ' if (__result) {'
+ print ' switch (name) {'
+ print ' case GL_EXTENSIONS:'
+ print ' __result = gltrace::translateExtensionsString(__result);'
+ print ' break;'
+ print ' default:'
+ print ' break;'
+ print ' }'
+ print ' }'
if function.name in ('glMapBuffer', 'glMapBufferARB'):
print ' struct buffer_mapping *mapping = get_buffer_mapping(target);'