From: Axel Davy Date: Thu, 4 Apr 2019 21:01:08 +0000 (+0200) Subject: st/nine: Upload managed textures only at draw using them X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5df96995efc37260b2675f61804c94a1a632609f;p=mesa.git st/nine: Upload managed textures only at draw using them When a draw call is emited, textures in the device->update_textures list are uploaded. This patch removes textures from the list if they are not bound anymore. Signed-off-by: Axel Davy --- diff --git a/src/gallium/state_trackers/nine/basetexture9.h b/src/gallium/state_trackers/nine/basetexture9.h index 19899c65825..7c6f66907b3 100644 --- a/src/gallium/state_trackers/nine/basetexture9.h +++ b/src/gallium/state_trackers/nine/basetexture9.h @@ -144,8 +144,11 @@ NineBindTextureToDevice( struct NineDevice9 *device, tex->bind_count++; } - if (old) + if (old) { old->bind_count--; + if (!old->bind_count) + list_delinit(&old->list); + } nine_bind(slot, tex); }