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

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 2 18:42:22 UTC 2021


Module: Mesa
Branch: staging/20.3
Commit: 2b66910037b0c0e545eae3d8305cf955bd907742
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2b66910037b0c0e545eae3d8305cf955bd907742

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>
(cherry picked from commit 969f50ddcfcf88f641779942210f33519761a08f)

---

 .pick_status.json                    | 2 +-
 src/gallium/auxiliary/draw/draw_gs.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 118f51cb0f1..5a72c7d76ba 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -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
     },
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