=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Fix bind count for shader resource views.

Alexandre Julliard julliard at winehq.org
Mon Feb 13 15:24:39 CST 2017


Module: wine
Branch: master
Commit: 94fab4cf1ac7d8a0311ee6284b41949eb7591e1b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=94fab4cf1ac7d8a0311ee6284b41949eb7591e1b

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Feb 13 13:07:33 2017 +0100

wined3d: Fix bind count for shader resource views.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/cs.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 1d2870e..3a46a3c 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -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);
 }




More information about the wine-cvs mailing list