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

Author: Mary Guillemard <mary.guillem...@collabora.com>
Date:   Thu Nov  2 06:37:31 2023 -0400

zink: Check for VK_EXT_extended_dynamic_state3 before setting A2C

Fix crashes for piglit alpha-to-coverage tests when
VK_EXT_extended_dynamic_state3 is not supported (like on Venus)

Fixes: 736577871b9 ("zink: check for cbuf0 writes before setting A2C")

Signed-off-by: Mary Guillemard <mary.guillem...@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.manisca...@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26003>

---

 src/gallium/drivers/zink/zink_program.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_program.c 
b/src/gallium/drivers/zink/zink_program.c
index c82607272d5..e50ad9c9c91 100644
--- a/src/gallium/drivers/zink/zink_program.c
+++ b/src/gallium/drivers/zink/zink_program.c
@@ -1871,7 +1871,8 @@ zink_bind_fs_state(struct pipe_context *pctx,
    if (cso) {
       shader_info *info = &ctx->gfx_stages[MESA_SHADER_FRAGMENT]->info;
       bool new_writes_cbuf0 = (info->outputs_written & 
BITFIELD_BIT(FRAG_RESULT_DATA0)) > 0;
-      if (ctx->gfx_pipeline_state.blend_state && 
ctx->gfx_pipeline_state.blend_state->alpha_to_coverage && writes_cbuf0 != 
new_writes_cbuf0) {
+      if (ctx->gfx_pipeline_state.blend_state && 
ctx->gfx_pipeline_state.blend_state->alpha_to_coverage &&
+          writes_cbuf0 != new_writes_cbuf0 && 
zink_screen(pctx->screen)->info.have_EXT_extended_dynamic_state3) {
          ctx->blend_state_changed = true;
          ctx->ds3_states |= BITFIELD_BIT(ZINK_DS3_BLEND_A2C);
       }

Reply via email to