st/mesa: release the draw shader properly to fix driver crashes (iris)

Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Marek Olšák 2019-12-09 22:35:57 -05:00
parent 41118246c6
commit 38e9eb9561
1 changed files with 5 additions and 1 deletions

View 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.
*/