gallium/draw: Fix intermittent failure to bind new geometry shaders.

If you deleted your old GS and created a new one, then it would
occasionally skip binding the new GS because the token pointers were
equal.  Clear the current token pointer in the machine when we're deleting
its token.

Cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8277>
(cherry picked from commit 969f50ddcf)
This commit is contained in:
Eric Anholt 2020-12-30 16:09:13 -08:00 committed by Dylan Baker
parent 2f6f5b3ba2
commit 2b66910037
2 changed files with 4 additions and 1 deletions

View file

@ -1120,7 +1120,7 @@
"description": "gallium/draw: Fix intermittent failure to bind new geometry shaders.",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -964,6 +964,9 @@ void draw_delete_geometry_shader(struct draw_context *draw,
}
#endif
if (draw->gs.tgsi.machine && draw->gs.tgsi.machine->Tokens == dgs->state.tokens)
draw->gs.tgsi.machine->Tokens = NULL;
for (i = 0; i < TGSI_MAX_VERTEX_STREAMS; i++)
FREE(dgs->stream[i].primitive_lengths);