From 16b6fb65ae03902f731b863802c094c4d854def1 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Thu, 1 Dec 2016 22:50:22 +0100 Subject: st/nine: Optimize managed buffer upload Do the upload in the other thread. Usually managed buffers are used once per frame. It is then very likely pending_upload is 0 at Lock time. Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/buffer9.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gallium/state_trackers/nine/buffer9.c') diff --git a/src/gallium/state_trackers/nine/buffer9.c b/src/gallium/state_trackers/nine/buffer9.c index 086985b0d5a..c745d77c2c2 100644 --- a/src/gallium/state_trackers/nine/buffer9.c +++ b/src/gallium/state_trackers/nine/buffer9.c @@ -223,11 +223,14 @@ NineBuffer9_Lock( struct NineBuffer9 *This, if (This->base.pool == D3DPOOL_MANAGED) { /* READONLY doesn't dirty the buffer */ + /* Tests on Win: READONLY doesn't wait for the upload */ if (!(Flags & D3DLOCK_READONLY)) { if (!This->managed.dirty) { assert(LIST_IS_EMPTY(&This->managed.list)); This->managed.dirty = TRUE; This->managed.dirty_box = box; + if (p_atomic_read(&This->managed.pending_upload)) + nine_csmt_process(This->base.base.device); } else u_box_union_2d(&This->managed.dirty_box, &This->managed.dirty_box, &box); } -- cgit v1.2.3