From: Axel Davy Date: Thu, 4 Apr 2019 21:06:44 +0000 (+0200) Subject: st/nine: Upload managed buffers only at draw using them X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bb3b8f8e01129ed35ea47463716def7c375f0f19;p=mesa.git 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 --- 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); }