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

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2020-05-13 01:12:56 +04:30 committed by Alexandre Julliard
parent 552b335ae8
commit 40e2784ed2
2 changed files with 4 additions and 8 deletions

View File

@ -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); 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) if (parameters->indirect)
{ {
const struct wined3d_indirect_dispatch_parameters *indirect = &parameters->u.indirect; const struct wined3d_indirect_dispatch_parameters *indirect = &parameters->u.indirect;

View File

@ -785,6 +785,9 @@ static void wined3d_cs_exec_dispatch(struct wined3d_cs *cs, const void *data)
const struct wined3d_cs_dispatch *op = data; const struct wined3d_cs_dispatch *op = data;
struct wined3d_state *state = &cs->state; struct wined3d_state *state = &cs->state;
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); cs->device->adapter->adapter_ops->adapter_dispatch_compute(cs->device, state, &op->parameters);
if (op->parameters.indirect) if (op->parameters.indirect)