st/nine: Track managed textures
authorAxel Davy <axel.davy@ens.fr>
Wed, 6 May 2015 22:03:21 +0000 (00:03 +0200)
committerAxel Davy <axel.davy@ens.fr>
Fri, 21 Aug 2015 20:21:46 +0000 (22:21 +0200)
Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/basetexture9.c
src/gallium/state_trackers/nine/basetexture9.h
src/gallium/state_trackers/nine/device9.c
src/gallium/state_trackers/nine/device9.h

index 728aafd9a593844bdae460388291ff00719e6533..c38a31010a109ab48c30d1bd9fb2f5c6f75c6072 100644 (file)
@@ -85,6 +85,9 @@ NineBaseTexture9_ctor( struct NineBaseTexture9 *This,
                    util_format_has_depth(util_format_description(This->base.info.format));
 
     list_inithead(&This->list);
+    list_inithead(&This->list2);
+    if (Pool == D3DPOOL_MANAGED)
+        list_add(&This->list2, &This->base.base.device->managed_textures);
 
     return D3D_OK;
 }
@@ -98,7 +101,9 @@ NineBaseTexture9_dtor( struct NineBaseTexture9 *This )
     pipe_sampler_view_reference(&This->view[1], NULL);
 
     if (This->list.prev != NULL && This->list.next != NULL)
-        list_del(&This->list),
+        list_del(&This->list);
+    if (This->list2.prev != NULL && This->list2.next != NULL)
+        list_del(&This->list2);
 
     NineResource9_dtor(&This->base);
 }
index 9d6fb0c002a7201e6df6021302dd075f9d1ba2c9..9489824299fd71446fa6993675428f01e49ab3ae 100644 (file)
@@ -30,7 +30,8 @@
 struct NineBaseTexture9
 {
     struct NineResource9 base;
-    struct list_head list;
+    struct list_head list; /* for update_textures */
+    struct list_head list2; /* for managed_textures */
 
     /* g3d */
     struct pipe_context *pipe;
index 91c1eaa9ef2260faba2cf7fce664281c15124d7e..34199ca9ef2fe823991e81aaa3a3b0131893d054 100644 (file)
@@ -186,6 +186,7 @@ NineDevice9_ctor( struct NineDevice9 *This,
     if (FAILED(hr)) { return hr; }
 
     list_inithead(&This->update_textures);
+    list_inithead(&This->managed_textures);
 
     This->screen = pScreen;
     This->caps = *pCaps;
index 74607451c5fabae6271eef9a1e2e3510693fa1c6..a5a5ab2391db8f7f61e5f43d0d05175230f70b96 100644 (file)
@@ -69,6 +69,7 @@ struct NineDevice9
     struct nine_state state;   /* device state */
 
     struct list_head update_textures;
+    struct list_head managed_textures;
 
     boolean is_recording;
     boolean in_scene;