Henri Verbeet : wined3d: Check for a bound compute shader in wined3d_cs_exec_dispatch().

Alexandre Julliard julliard at winehq.org
Tue May 12 16:59:28 CDT 2020


Module: wine
Branch: master
Commit: 40e2784ed2dc604f9e0779cf6425921aff9ffcb5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=40e2784ed2dc604f9e0779cf6425921aff9ffcb5

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed May 13 01:30:56 2020 +0430

wined3d: Check for a bound compute shader in wined3d_cs_exec_dispatch().

Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/context_gl.c | 7 -------
 dlls/wined3d/cs.c         | 5 ++++-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index c21ecfd5c3..b168e6026a 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -3901,13 +3901,6 @@ void dispatch_compute(struct wined3d_device *device, const struct wined3d_state
 
     wined3d_context_gl_apply_compute_state(context_gl, device, state);
 
-    if (!state->shader[WINED3D_SHADER_TYPE_COMPUTE])
-    {
-        context_release(&context_gl->c);
-        WARN("No compute shader bound, skipping dispatch.\n");
-        return;
-    }
-
     if (parameters->indirect)
     {
         const struct wined3d_indirect_dispatch_parameters *indirect = &parameters->u.indirect;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 85e696d4d1..c704daaf57 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -785,7 +785,10 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
     const struct wined3d_cs_dispatch *op = data;
     struct wined3d_state *state = &cs->state;
 
-    cs->device->adapter->adapter_ops->adapter_dispatch_compute(cs->device, state, &op->parameters);
+    if (!state->shader[WINED3D_SHADER_TYPE_COMPUTE])
+        WARN("No compute shader bound, skipping dispatch.\n");
+    else
+        cs->device->adapter->adapter_ops->adapter_dispatch_compute(cs->device, state, &op->parameters);
 
     if (op->parameters.indirect)
         wined3d_resource_release(&op->parameters.u.indirect.buffer->resource);




More information about the wine-cvs mailing list