From: Marek Olšák Date: Tue, 10 Dec 2019 03:35:57 +0000 (-0500) Subject: st/mesa: release the draw shader properly to fix driver crashes (iris) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=38e9eb9561d49f9798b03627276d0d4ea4c5d7ff;p=mesa.git st/mesa: release the draw shader properly to fix driver crashes (iris) Reviewed-by: Dave Airlie --- diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 84fd8e320af..a9ff68c1f50 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -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. */