mesa/st: unbind shader state before deleting it
authorTapani Pälli <tapani.palli@intel.com>
Thu, 2 Apr 2020 09:54:17 +0000 (12:54 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 6 Apr 2020 05:00:00 +0000 (08:00 +0300)
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>

src/mesa/state_tracker/st_context.c

index 846a76c173358f2c9d236bed2519b58ce07f4899..fa309436408f2843a3b05555aef35fd82918252e 100644 (file)
@@ -399,21 +399,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: