Commit 94fab4cf authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Fix bind count for shader resource views.

parent 2d3e23c6
...@@ -1039,8 +1039,16 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined ...@@ -1039,8 +1039,16 @@ void wined3d_cs_emit_set_texture(struct wined3d_cs *cs, UINT stage, struct wined
static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data) static void wined3d_cs_exec_set_shader_resource_view(struct wined3d_cs *cs, const void *data)
{ {
const struct wined3d_cs_set_shader_resource_view *op = data; const struct wined3d_cs_set_shader_resource_view *op = data;
struct wined3d_shader_resource_view *prev;
prev = cs->state.shader_resource_view[op->type][op->view_idx];
cs->state.shader_resource_view[op->type][op->view_idx] = op->view; cs->state.shader_resource_view[op->type][op->view_idx] = op->view;
if (op->view)
InterlockedIncrement(&op->view->resource->bind_count);
if (prev)
InterlockedDecrement(&prev->resource->bind_count);
if (op->type != WINED3D_SHADER_TYPE_COMPUTE) if (op->type != WINED3D_SHADER_TYPE_COMPUTE)
device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING); device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING);
} }
......
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