zink - Fix for blend color change without blend state change

Flag blend color change and make sure vkCmdSetBlendConstants is called.

Signed-off-by: daoxianggong <daoxiang.gong@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26799>
This commit is contained in:
daoxianggong
2024-01-03 13:20:45 +01:00
committed by Marge Bot
parent 53efd35acc
commit d6f0f46ae4
3 changed files with 5 additions and 1 deletions

View File

@@ -3713,6 +3713,8 @@ zink_set_blend_color(struct pipe_context *pctx,
{
struct zink_context *ctx = zink_context(pctx);
memcpy(ctx->blend_constants, color->color, sizeof(float) * 4);
ctx->blend_color_changed = true;
zink_flush_dgc_if_enabled(ctx);
}

View File

@@ -874,10 +874,11 @@ zink_draw(struct pipe_context *pctx,
ctx->sample_locations_changed = false;
}
if (BATCH_CHANGED || ctx->blend_state_changed) {
if (BATCH_CHANGED || ctx->blend_color_changed) {
VKCTX(CmdSetBlendConstants)(batch->state->cmdbuf, ctx->blend_constants);
}
ctx->blend_state_changed = false;
ctx->blend_color_changed = false;
if (!DRAW_STATE) {
if (BATCH_CHANGED || ctx->vertex_buffers_dirty) {

View File

@@ -2032,6 +2032,7 @@ struct zink_context {
bool unordered_blitting : 1;
bool vertex_state_changed : 1;
bool blend_state_changed : 1;
bool blend_color_changed : 1;
bool sample_mask_changed : 1;
bool rast_state_changed : 1;
bool line_width_changed : 1;