wined3d: Fix bind count for shader resource views.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Józef Kucia 2017-02-13 13:07:33 +01:00 committed by Alexandre Julliard
parent 2d3e23c60f
commit 94fab4cf1a
1 changed files with 8 additions and 0 deletions

View File

@ -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)
{
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;
if (op->view)
InterlockedIncrement(&op->view->resource->bind_count);
if (prev)
InterlockedDecrement(&prev->resource->bind_count);
if (op->type != WINED3D_SHADER_TYPE_COMPUTE)
device_invalidate_state(cs->device, STATE_SHADER_RESOURCE_BINDING);
}