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: 736577871b ("zink: check for cbuf0 writes before setting A2C")

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26003>
This commit is contained in:
Mary Guillemard 2023-11-02 06:37:31 -04:00 committed by Marge Bot
parent 88cbe32048
commit fe159c85de

View file

@ -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);
}