aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-05-13 15:43:58 -0400
committerMarge Bot <[email protected]>2020-05-15 22:26:52 +0000
commitfd6a5e112aa1fd09bc01f4cf3ca211ad73cc404e (patch)
tree8f1989da8233e77882d87cf049af6b8d4d76b162
parentc9ccceff1092049b081db88e53db8335a0a64951 (diff)
gallium/u_threaded: execute transfer_unmap with THREAD_SAFE directly
This was the original intention, but it wasn't fully implemented. Fixes: 7f22e0fd29369f478da1d36520049f001cd698d1 Closes: #2953 Tested by: John Galt <[email protected]> Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5030>
-rw-r--r--src/gallium/auxiliary/util/u_threaded_context.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index 9e835867ef3..72111f34c01 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -1599,6 +1599,21 @@ tc_transfer_unmap(struct pipe_context *_pipe, struct pipe_transfer *transfer)
struct threaded_transfer *ttrans = threaded_transfer(transfer);
struct threaded_resource *tres = threaded_resource(transfer->resource);
+ /* PIPE_TRANSFER_THREAD_SAFE is only valid with UNSYNCHRONIZED. It can be
+ * called from any thread and bypasses all multithreaded queues.
+ */
+ if (transfer->usage & PIPE_TRANSFER_THREAD_SAFE) {
+ assert(transfer->usage & PIPE_TRANSFER_UNSYNCHRONIZED);
+ assert(!(transfer->usage & (PIPE_TRANSFER_FLUSH_EXPLICIT |
+ PIPE_TRANSFER_DISCARD_RANGE)));
+
+ struct pipe_context *pipe = tc->pipe;
+ pipe->transfer_unmap(pipe, transfer);
+ util_range_add(&tres->b, tres->base_valid_buffer_range,
+ transfer->box.x, transfer->box.x + transfer->box.width);
+ return;
+ }
+
if (tres->b.target == PIPE_BUFFER) {
if (transfer->usage & PIPE_TRANSFER_WRITE &&
!(transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT))