Module: wine Branch: master Commit: 3cc218d5b51140354afdd689c67be9258476a1e3 URL: https://source.winehq.org/git/wine.git/?a=commit;h=3cc218d5b51140354afdd689c...
Author: Matteo Bruni mbruni@codeweavers.com Date: Thu Mar 26 13:26:01 2020 +0100
wined3d: Only invalidate STATE_INDEXBUFFER if the buffer being destroyed is bound as index buffer.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/wined3d/buffer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 427b1a2649..dffa703dcc 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -144,6 +144,8 @@ static void wined3d_buffer_gl_destroy_buffer_object(struct wined3d_buffer_gl *bu { const struct wined3d_gl_info *gl_info = context_gl->gl_info; struct wined3d_resource *resource = &buffer_gl->b.resource; + struct wined3d_buffer *buffer = &buffer_gl->b; + struct wined3d_cs *cs = resource->device->cs; GLuint bo;
if (!buffer_gl->b.buffer_object) @@ -158,7 +160,8 @@ static void wined3d_buffer_gl_destroy_buffer_object(struct wined3d_buffer_gl *bu { if (resource->bind_flags & WINED3D_BIND_VERTEX_BUFFER) device_invalidate_state(resource->device, STATE_STREAMSRC); - if (resource->bind_flags & WINED3D_BIND_INDEX_BUFFER) + if (resource->bind_flags & WINED3D_BIND_INDEX_BUFFER + && cs->state.index_buffer == buffer) device_invalidate_state(resource->device, STATE_INDEXBUFFER); if (resource->bind_flags & WINED3D_BIND_CONSTANT_BUFFER) {