Commit 3cc218d5 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Only invalidate STATE_INDEXBUFFER if the buffer being destroyed is bound as index buffer.

parent b83b897b
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment