diff options
author | Axel Davy <[email protected]> | 2016-12-04 10:34:34 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2016-12-20 23:47:08 +0100 |
commit | 1e64be6f91652e7e5ba60c86c379ee41bb7e4f81 (patch) | |
tree | 5e88e84c43f3cabfb5f46ddf6b414736f5ca4c31 /src/gallium/state_trackers | |
parent | b4f16615ef6546c6f8eab8a2d2a50cdab1773a91 (diff) |
st/nine: Do not wait for DEFAULT lock for volumes when we can
If the volumes (and the texture container) are not referenced,
then they are no pending operations on them. We can lock directly.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/nine/volume9.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/volume9.c b/src/gallium/state_trackers/nine/volume9.c index 29a1fcbbd03..11236a02e75 100644 --- a/src/gallium/state_trackers/nine/volume9.c +++ b/src/gallium/state_trackers/nine/volume9.c @@ -320,10 +320,17 @@ NineVolume9_LockBox( struct NineVolume9 *This, pLockedVolume->pBits = NineVolume9_GetSystemMemPointer(This, box.x, box.y, box.z); } else { - pipe = NineDevice9_GetPipe(This->base.device); + bool no_refs = !p_atomic_read(&This->base.bind) && + !p_atomic_read(&This->base.container->bind); + if (no_refs) + pipe = nine_context_get_pipe_acquire(This->base.device); + else + pipe = NineDevice9_GetPipe(This->base.device); pLockedVolume->pBits = pipe->transfer_map(pipe, resource, This->level, usage, &box, &This->transfer); + if (no_refs) + nine_context_get_pipe_release(This->base.device); if (!This->transfer) { if (Flags & D3DLOCK_DONOTWAIT) return D3DERR_WASSTILLDRAWING; |