Mesa (main): zink: always update shader variants when rebinding a gfx program

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Mar 7 04:17:38 UTC 2022


Module: Mesa
Branch: main
Commit: 9a6c58b2f7da74c5c20258f9a0b2c3681e79ef17
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a6c58b2f7da74c5c20258f9a0b2c3681e79ef17

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Mar  1 12:06:13 2022 -0500

zink: always update shader variants when rebinding a gfx program

the variant data may have changed in the meanwhile, so do a pass to
ensure that the correct variant is used

cc: mesa-stable

fixes caselist:
dEQP-GLES31.functional.shaders.sample_variables.sample_mask.discard_half_per_two_samples.multisample_texture_4
dEQP-GLES31.functional.shaders.sample_variables.sample_mask.discard_half_per_two_samples.singlesample_rbo

Acked-by: Emma Anholt <emma at anholt.net>
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15226>

---

 src/gallium/drivers/zink/zink_draw.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp
index 5a5170fda2d..5c7046de5da 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -215,6 +215,8 @@ update_gfx_program(struct zink_context *ctx)
          prog = (struct zink_gfx_program*)entry->data;
          u_foreach_bit(stage, prog->stages_present & ~ctx->dirty_shader_stages)
             ctx->gfx_pipeline_state.modules[stage] = prog->modules[stage]->shader;
+         /* ensure variants are always updated if keys have changed since last use */
+         ctx->dirty_shader_stages |= prog->stages_present;
       } else {
          ctx->dirty_shader_stages |= bits;
          prog = zink_create_gfx_program(ctx, ctx->gfx_stages, ctx->gfx_pipeline_state.vertices_per_patch + 1);



More information about the mesa-commit mailing list