mesa/st: unbind shader state before deleting it

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4386>
(cherry picked from commit 4822cc9700)
This commit is contained in:
Tapani Pälli 2020-04-02 12:54:17 +03:00 committed by Dylan Baker
parent 3d5d4ee8e6
commit 1fdf425560
2 changed files with 7 additions and 1 deletions

View file

@ -1282,7 +1282,7 @@
"description": "mesa/st: unbind shader state before deleting it",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -396,21 +396,27 @@ free_zombie_shaders(struct st_context *st)
switch (entry->type) {
case PIPE_SHADER_VERTEX:
st->pipe->bind_vs_state(st->pipe, NULL);
st->pipe->delete_vs_state(st->pipe, entry->shader);
break;
case PIPE_SHADER_FRAGMENT:
st->pipe->bind_fs_state(st->pipe, NULL);
st->pipe->delete_fs_state(st->pipe, entry->shader);
break;
case PIPE_SHADER_GEOMETRY:
st->pipe->bind_gs_state(st->pipe, NULL);
st->pipe->delete_gs_state(st->pipe, entry->shader);
break;
case PIPE_SHADER_TESS_CTRL:
st->pipe->bind_tcs_state(st->pipe, NULL);
st->pipe->delete_tcs_state(st->pipe, entry->shader);
break;
case PIPE_SHADER_TESS_EVAL:
st->pipe->bind_tes_state(st->pipe, NULL);
st->pipe->delete_tes_state(st->pipe, entry->shader);
break;
case PIPE_SHADER_COMPUTE:
st->pipe->bind_compute_state(st->pipe, NULL);
st->pipe->delete_compute_state(st->pipe, entry->shader);
break;
default: