[PATCH] wined3d: Invalidate INDEXBUFFER device state when bound index buffer is unloaded.

Józef Kucia jkucia at codeweavers.com
Mon Oct 31 06:48:31 CDT 2016


Fixes a regression introduced by commit
e3a8cd20ced9f33db64a35f60bc8487ae8173e47.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/buffer.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index a81cd64..13953c9 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -665,7 +665,12 @@ static void buffer_unload(struct wined3d_resource *resource)
          * happens only once per changed vertexbuffer and should occur rather
          * rarely. */
         if (resource->bind_count)
+        {
             device_invalidate_state(device, STATE_STREAMSRC);
+
+            if (buffer->buffer_type_hint == GL_ELEMENT_ARRAY_BUFFER)
+                device_invalidate_state(device, STATE_INDEXBUFFER);
+        }
     }
 
     resource_unload(resource);
-- 
2.7.3




More information about the wine-patches mailing list