From 2579355eea1eec6ea0faed32058f44368fb1e911 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 1 Mar 2022 12:06:13 -0500 Subject: [PATCH] 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 Reviewed-by: Dave Airlie Part-of: (cherry picked from commit 9a6c58b2f7da74c5c20258f9a0b2c3681e79ef17) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_draw.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 1e7adee4c47..43f4d729b90 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1696,7 +1696,7 @@ "description": "zink: always update shader variants when rebinding a gfx program", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index e97713e99d6..e7c6af72af3 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -193,6 +193,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);