st/mesa: release the draw shader properly to fix driver crashes (iris)
authorMarek Olšák <marek.olsak@amd.com>
Tue, 10 Dec 2019 03:35:57 +0000 (22:35 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 10 Dec 2019 03:41:41 +0000 (22:41 -0500)
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/state_tracker/st_program.c

index 84fd8e320af81c4a7ea84e4eee0fec21bc92c940..a9ff68c1f5098e68374f61b77e1cdad9fafe7207 100644 (file)
@@ -218,7 +218,11 @@ static void
 delete_variant(struct st_context *st, struct st_variant *v, GLenum target)
 {
    if (v->driver_shader) {
-      if (st->has_shareable_shaders || v->st == st) {
+      if (target == GL_VERTEX_PROGRAM_ARB &&
+          ((struct st_common_variant*)v)->key.is_draw_shader) {
+         /* Draw shader. */
+         draw_delete_vertex_shader(st->draw, v->driver_shader);
+      } else if (st->has_shareable_shaders || v->st == st) {
          /* The shader's context matches the calling context, or we
           * don't care.
           */