diff options
author | Axel Davy <[email protected]> | 2019-04-04 23:06:44 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2019-04-30 19:18:50 +0200 |
commit | bb3b8f8e01129ed35ea47463716def7c375f0f19 (patch) | |
tree | 77903fa311ee312bd34d08527115e3eaa5a6a7dd /src/gallium/state_trackers | |
parent | 5df96995efc37260b2675f61804c94a1a632609f (diff) |
st/nine: Upload managed buffers only at draw using them
When a draw call is emited, buffers in the
device->update_buffers list are uploaded.
This patch removes buffers from the list if they
are not bound anymore.
Behaviour found studying:
https://github.com/iXit/Mesa-3D/issues/345
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/nine/buffer9.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/buffer9.h b/src/gallium/state_trackers/nine/buffer9.h index 1803d8d6405..9ccd6dab990 100644 --- a/src/gallium/state_trackers/nine/buffer9.h +++ b/src/gallium/state_trackers/nine/buffer9.h @@ -125,8 +125,11 @@ NineBindBufferToDevice( struct NineDevice9 *device, list_add(&buf->managed.list, &device->update_buffers); buf->bind_count++; } - if (old) + if (old) { old->bind_count--; + if (!old->bind_count && old->managed.dirty) + list_delinit(&old->managed.list); + } nine_bind(slot, buf); } |