st/nine: Upload managed textures only at draw using them
authorAxel Davy <davyaxel0@gmail.com>
Thu, 4 Apr 2019 21:01:08 +0000 (23:01 +0200)
committerAxel Davy <davyaxel0@gmail.com>
Tue, 30 Apr 2019 17:18:50 +0000 (19:18 +0200)
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 <davyaxel0@gmail.com>
src/gallium/state_trackers/nine/basetexture9.h

index 19899c65825747ae23c77e69add132ab94846074..7c6f66907b327244008031c0cdeb6bfa1f62f424 100644 (file)
@@ -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);
 }