aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-05-12 01:25:49 +0200
committerMarek Olšák <[email protected]>2017-05-15 13:01:33 +0200
commite24d094d70a1ccd4d41b8dd245e2e3f95fb95498 (patch)
tree38b6ee9170569e11cdb88d6a9aaaffd3ea4182a1 /src/gallium/auxiliary/util
parent4c98afb241fbb8a7bbebb140a0ce74d24c842d48 (diff)
gallium/u_threaded: drop and ignore all non-async debug callbacks
This is necessary to comply with OpenGL. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_threaded_context.c7
-rw-r--r--src/gallium/auxiliary/util/u_threaded_context.h4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index b44430fd096..50cb820440c 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -1592,6 +1592,13 @@ tc_set_debug_callback(struct pipe_context *_pipe,
struct threaded_context *tc = threaded_context(_pipe);
struct pipe_context *pipe = tc->pipe;
+ /* Drop all synchronous debug callbacks. Drivers are expected to be OK
+ * with this. shader-db will use an environment variable to disable
+ * the threaded context.
+ */
+ if (cb && cb->debug_message && !cb->async)
+ return;
+
tc_sync(tc);
pipe->set_debug_callback(pipe, cb);
}
diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h
index ea58d4ca0cf..f13923050a0 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.h
+++ b/src/gallium/auxiliary/util/u_threaded_context.h
@@ -55,9 +55,7 @@
* - generate_mipmap uses is_format_supported to determine success;
* the return value from the driver is ignored.
* - resource_commit always returns true; failures are ignored.
- * - If a non-async debug callback is set, the threaded context keeps using
- * asynchronous execution. This is OK for shader-db, but the driver
- * shouldn't use the debug callback in any other way.
+ * - set_debug_callback is skipped if the callback is synchronous.
*
*
* Thread-safety requirements on context functions