out('return {0};'.format(call))
def print_sync_dispatch(self, func):
- out('debug_print_sync_fallback("{0}");'.format(func.name))
self.print_sync_call(func)
def print_sync_body(self, func):
out('{')
with indent():
out('GET_CURRENT_CONTEXT(ctx);')
- out('_mesa_glthread_finish(ctx);')
- out('debug_print_sync("{0}");'.format(func.name))
+ out('_mesa_glthread_finish_before(ctx, "{0}");'.format(func.name))
self.print_sync_call(func)
out('}')
out('')
if func.marshal_fail:
out('if ({0}) {{'.format(func.marshal_fail))
with indent():
- out('_mesa_glthread_finish(ctx);')
- out('_mesa_glthread_restore_dispatch(ctx, __func__);')
+ out('_mesa_glthread_disable(ctx, "{0}");'.format(func.name))
self.print_sync_dispatch(func)
out('return;')
out('}')
if need_fallback_sync:
out('fallback_to_sync:')
with indent():
- out('_mesa_glthread_finish(ctx);')
+ out('_mesa_glthread_finish_before(ctx, "{0}");'.format(func.name))
self.print_sync_dispatch(func)
else:
with indent():
}
}
+void
+_mesa_glthread_disable(struct gl_context *ctx, const char *func)
+{
+ _mesa_glthread_finish_before(ctx, func);
+ _mesa_glthread_restore_dispatch(ctx, func);
+}
+
void
_mesa_glthread_flush_batch(struct gl_context *ctx)
{
if (synced)
p_atomic_inc(&glthread->stats.num_syncs);
}
+
+void
+_mesa_glthread_finish_before(struct gl_context *ctx, const char *func)
+{
+ _mesa_glthread_finish(ctx);
+ debug_print_sync_fallback(func);
+}
void _mesa_glthread_destroy(struct gl_context *ctx);
void _mesa_glthread_restore_dispatch(struct gl_context *ctx, const char *func);
+void _mesa_glthread_disable(struct gl_context *ctx, const char *func);
void _mesa_glthread_flush_batch(struct gl_context *ctx);
void _mesa_glthread_finish(struct gl_context *ctx);
+void _mesa_glthread_finish_before(struct gl_context *ctx, const char *func);
#endif /* _GLTHREAD_H*/
debug_print_marshal("Enable");
if (cap == GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB) {
- _mesa_glthread_finish(ctx);
- _mesa_glthread_restore_dispatch(ctx, "Enable(DEBUG_OUTPUT_SYNCHRONOUS)");
+ _mesa_glthread_disable(ctx, "Enable(DEBUG_OUTPUT_SYNCHRONOUS)");
} else {
cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Enable,
sizeof(*cmd));