Mesa (staging/22.1): zink: fix generated tcs update path

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 15 16:22:56 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: 3e7c8c0c8ad11376aef851e83abc19bbae249f31
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e7c8c0c8ad11376aef851e83abc19bbae249f31

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Jun  7 14:23:07 2022 -0400

zink: fix generated tcs update path

is_generated is in a union with the generated tcs pointer for tes shaders,
so check the shader stage too

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17010>
(cherry picked from commit 338d98643906141322432874c91a1a8528a85e3a)

---

 .pick_status.json                       | 2 +-
 src/gallium/drivers/zink/zink_program.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index f9afc9ff88f..487f6b9ae57 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1210,7 +1210,7 @@
         "description": "zink: fix generated tcs update path",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c
index 85ed5e3e0cc..29dffd49589 100644
--- a/src/gallium/drivers/zink/zink_program.c
+++ b/src/gallium/drivers/zink/zink_program.c
@@ -128,7 +128,7 @@ get_shader_module_for_stage(struct zink_context *ctx, struct zink_screen *screen
       if (!zm) {
          return NULL;
       }
-      if (zs->is_generated && zs->spirv) {
+      if (pstage == PIPE_SHADER_TESS_CTRL && zs->is_generated && zs->spirv) {
          assert(ctx); //TODO async
          mod = zink_shader_tcs_compile(screen, zs, zink_get_tcs_key(ctx)->patch_vertices);
       } else {
@@ -155,7 +155,7 @@ get_shader_module_for_stage(struct zink_context *ctx, struct zink_screen *screen
       zm->has_nonseamless = !!nonseamless_size;
       if (inline_size)
          memcpy(zm->key + key->size + nonseamless_size, key->base.inlined_uniform_values, inline_size * sizeof(uint32_t));
-      if (zs->is_generated)
+      if (pstage == PIPE_SHADER_TESS_CTRL && zs->is_generated)
          zm->hash = zink_get_tcs_key(ctx)->patch_vertices;
       else
          zm->hash = shader_module_hash(zm);



More information about the mesa-commit mailing list