Mesa (master): gallium/draw: Fix intermittent failure to bind new geometry shaders.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 31 06:12:17 UTC 2020


Module: Mesa
Branch: master
Commit: 969f50ddcfcf88f641779942210f33519761a08f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=969f50ddcfcf88f641779942210f33519761a08f

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Dec 30 16:09:13 2020 -0800

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 at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8277>

---

 src/gallium/auxiliary/draw/draw_gs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index 9f9983d8350..3e087b9c923 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -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);
 



More information about the mesa-commit mailing list