bool insideList = false;
bool insideGlBeginEnd = false;
+bool supportsARBShaderObjects = false;
enum {
GPU_START = 0,
supportsElapsed = currentContext->hasExtension("GL_EXT_timer_query") || supportsTimestamp;
supportsOcclusion = currentContext->hasExtension("GL_ARB_occlusion_query");
supportsDebugOutput = currentContext->hasExtension("GL_ARB_debug_output");
+ supportsARBShaderObjects = currentContext->hasExtension("GL_ARB_shader_objects");
/* Check for timer query support */
if (retrace::profilingGpuTimes) {
print ' if (retrace::verbosity >= 2) {'
print ' std::cout << "%s " << size_t(%s) << " <- " << size_t(%s) << "\\n";' % (handle.name, lvalue, new_lvalue)
print ' }'
- print ' %s = %s;' % (lvalue, new_lvalue)
+ if (new_lvalue.startswith('_program_map') or new_lvalue.startswith('_shader_map')):
+ print 'if (glretrace::supportsARBShaderObjects) {'
+ print ' %s = _handleARB_map[%s];' % (lvalue, lvalue)
+ print '} else {'
+ print ' %s = %s;' % (lvalue, new_lvalue)
+ print '}'
+ else:
+ print ' %s = %s;' % (lvalue, new_lvalue)
def visitBlob(self, blob, lvalue, rvalue):
print ' %s = static_cast<%s>((%s).toPointer());' % (lvalue, blob, rvalue)
OpaqueValueDeserializer().visit(handle.type, '_origResult', rvalue);
if handle.range is None:
rvalue = "_origResult"
- entry = lookupHandle(handle, rvalue)
- print " %s = %s;" % (entry, lvalue)
+ entry = lookupHandle(handle, rvalue)
+ if (entry.startswith('_program_map') or entry.startswith('_shader_map')):
+ print 'if (glretrace::supportsARBShaderObjects) {'
+ print ' _handleARB_map[%s] = %s;' % (rvalue, lvalue)
+ print '} else {'
+ print ' %s = %s;' % (entry, lvalue)
+ print '}'
+ else:
+ print " %s = %s;" % (entry, lvalue)
print ' if (retrace::verbosity >= 2) {'
print ' std::cout << "{handle.name} " << {rvalue} << " -> " << {lvalue} << "\\n";'.format(**locals())
print ' }'