void
beginProfile(trace::Call &call, bool isDraw) {
+ glretrace::Context *currentContext = glretrace::getCurrentContext();
+
/* Create call query */
CallQuery query;
query.isDraw = isDraw;
query.call = call.no;
query.sig = call.sig;
- query.program = glretrace::currentContext ? glretrace::currentContext->activeProgram : 0;
+ query.program = currentContext ? currentContext->activeProgram : 0;
/* GPU profiling only for draw calls */
if (isDraw) {
void
initContext() {
+ glretrace::Context *currentContext = glretrace::getCurrentContext();
+
/* Ensure we have adequate extension support */
assert(currentContext);
supportsTimestamp = currentContext->hasExtension("GL_ARB_timer_query");
/* Setup debug message call back */
if (retrace::debug && supportsDebugOutput) {
+ glretrace::Context *currentContext = glretrace::getCurrentContext();
glDebugMessageCallbackARB(&debugOutputCallback, currentContext);
if (DEBUG_OUTPUT_SYNCHRONOUS) {
retrace::frameComplete(call);
+ glretrace::Context *currentContext = glretrace::getCurrentContext();
if (!currentContext) {
return;
}
+ assert(currentContext->drawable);
if (retrace::debug && !currentContext->drawable->visible) {
retrace::warning(call) << "could not infer drawable size (glViewport never called)\n";
}
image::Image *
retrace::getSnapshot(void) {
- if (!glretrace::currentContext) {
+ if (!glretrace::getCurrentContext()) {
return NULL;
}
bool
retrace::dumpState(std::ostream &os)
{
+ glretrace::Context *currentContext = glretrace::getCurrentContext();
+
if (glretrace::insideGlBeginEnd ||
- !glretrace::currentContext) {
+ !currentContext) {
return false;
}
void
retrace::flushRendering(void) {
- glretrace::flushQueries();
- glFlush();
+ glretrace::Context *currentContext = glretrace::getCurrentContext();
+ if (currentContext) {
+ glretrace::flushQueries();
+ glFlush();
+ }
}
void