From 95961596d42b7e1c5a1721db0d19f257d1daaf64 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 19 Jan 2023 15:22:08 -0500 Subject: [PATCH] zink: delete need_blend_constants this is an artifact of very old code before the dynamic state was set for all graphics pipelines now the checks only cause blend constants to not be updated, which triggers bugs and validation failures cc: mesa-stable Part-of: (cherry picked from commit b4d18f2ad112e96320f6c5d130396a70ab702792) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_draw.cpp | 3 +-- src/gallium/drivers/zink/zink_state.c | 23 ----------------------- src/gallium/drivers/zink/zink_types.h | 1 - 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 9a87ace..e2d8b53 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2083,7 +2083,7 @@ "description": "zink: delete need_blend_constants", "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 1f1936e..035e20b 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -736,8 +736,7 @@ zink_draw(struct pipe_context *pctx, ctx->sample_locations_changed = false; } - if ((BATCH_CHANGED || ctx->blend_state_changed) && - ctx->gfx_pipeline_state.blend_state->need_blend_constants) { + if (BATCH_CHANGED || ctx->blend_state_changed) { VKCTX(CmdSetBlendConstants)(batch->state->cmdbuf, ctx->blend_constants); } ctx->blend_state_changed = false; diff --git a/src/gallium/drivers/zink/zink_state.c b/src/gallium/drivers/zink/zink_state.c index 8d0ba5d..1953d05 100644 --- a/src/gallium/drivers/zink/zink_state.c +++ b/src/gallium/drivers/zink/zink_state.c @@ -280,21 +280,6 @@ blend_factor(enum pipe_blendfactor factor) } -static bool -need_blend_constants(enum pipe_blendfactor factor) -{ - switch (factor) { - case PIPE_BLENDFACTOR_CONST_COLOR: - case PIPE_BLENDFACTOR_CONST_ALPHA: - case PIPE_BLENDFACTOR_INV_CONST_COLOR: - case PIPE_BLENDFACTOR_INV_CONST_ALPHA: - return true; - - default: - return false; - } -} - static VkBlendOp blend_op(enum pipe_blend_func func) { @@ -371,8 +356,6 @@ zink_create_blend_state(struct pipe_context *pctx, cso->alpha_to_coverage = blend_state->alpha_to_coverage; cso->alpha_to_one = blend_state->alpha_to_one; - cso->need_blend_constants = false; - for (int i = 0; i < blend_state->max_rt + 1; ++i) { const struct pipe_rt_blend_state *rt = blend_state->rt; if (blend_state->independent_blend_enable) @@ -388,12 +371,6 @@ zink_create_blend_state(struct pipe_context *pctx, att.srcAlphaBlendFactor = blend_factor(fix_blendfactor(rt->alpha_src_factor, cso->alpha_to_one)); att.dstAlphaBlendFactor = blend_factor(fix_blendfactor(rt->alpha_dst_factor, cso->alpha_to_one)); att.alphaBlendOp = blend_op(rt->alpha_func); - - if (need_blend_constants(rt->rgb_src_factor) || - need_blend_constants(rt->rgb_dst_factor) || - need_blend_constants(rt->alpha_src_factor) || - need_blend_constants(rt->alpha_dst_factor)) - cso->need_blend_constants = true; } if (rt->colormask & PIPE_MASK_R) diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index a179f39..7bbbfb4 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -318,7 +318,6 @@ struct zink_blend_state { VkBool32 alpha_to_coverage; VkBool32 alpha_to_one; - bool need_blend_constants; bool dual_src_blend; }; -- 2.7.4