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:
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user