diff options
author | Axel Davy <[email protected]> | 2016-02-27 11:02:21 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-02-29 18:55:58 +0100 |
commit | 83bc2acfe90fd2e503bab4b5a586c1e2822863f5 (patch) | |
tree | e56cc33a5be6fc24a4d38d208364ca7c37760cbe | |
parent | 44246fe99d4c880b70a58043624bf023237009f5 (diff) |
st/nine: Fix second Multithreading issue with MANAGED buffers
Here is another threading issue with MANAGED buffers:
Thread 1: buffer creation
Thread 1: buffer lock
Thread 2: Draw call
Thread 1: writes data
Thread 1: Unlock
Without this patch, the buffer is initially dirty
and in the list of things to upload after its creation.
The draw call will then upload the data and unset the dirty flag,
and the Unlock won't trigger a second upload.
Fixes regression introduced by cc0114f30b587a10766ec212afb3ad356099ef23:
"st/nine: Implement Managed vertex/index buffers"
Cc: "11.2" <[email protected]>
Signed-off-by: Axel Davy <[email protected]>
-rw-r--r-- | src/gallium/state_trackers/nine/buffer9.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/buffer9.c b/src/gallium/state_trackers/nine/buffer9.c index 6d5d9d691f8..1103741f7ee 100644 --- a/src/gallium/state_trackers/nine/buffer9.c +++ b/src/gallium/state_trackers/nine/buffer9.c @@ -182,6 +182,9 @@ NineBuffer9_Lock( struct NineBuffer9 *This, This->managed.dirty_box = box; } else { u_box_union_2d(&This->managed.dirty_box, &This->managed.dirty_box, &box); + /* Do not upload while we are locking, we'll add it back later */ + if (!LIST_IS_EMPTY(&This->managed.list)) + list_delinit(&This->managed.list); } } *ppbData = (char *)This->managed.data + OffsetToLock; |