mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 19:20:08 +01:00
gallium/u_threaded: execute transfer_unmap with THREAD_SAFE directly
This was the original intention, but it wasn't fully implemented.
Fixes: 7f22e0fd29
Closes: #2953
Tested by: John Galt <johngalt@fake.mail>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5030>
This commit is contained in:
parent
c9ccceff10
commit
fd6a5e112a
1 changed files with 15 additions and 0 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue