zink: add changed flag for blend states

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11968>
This commit is contained in:
Mike Blumenkrantz 2021-05-11 19:57:31 -04:00 committed by Marge Bot
parent df243d0094
commit 3db856689d
3 changed files with 6 additions and 1 deletions

View File

@ -299,6 +299,7 @@ struct zink_context {
bool have_timelines;
bool is_device_lost;
bool blend_state_changed : 1;
bool rast_state_changed : 1;
bool dsa_state_changed : 1;
bool stencil_ref_changed : 1;

View File

@ -642,8 +642,11 @@ zink_draw_vbo(struct pipe_context *pctx,
ctx->sample_locations_changed = false;
}
if (ctx->gfx_pipeline_state.blend_state->need_blend_constants)
if ((BATCH_CHANGED || ctx->blend_state_changed) &&
ctx->gfx_pipeline_state.blend_state->need_blend_constants) {
vkCmdSetBlendConstants(batch->state->cmdbuf, ctx->blend_constants);
}
ctx->blend_state_changed = false;
if (BATCH_CHANGED || ctx->vertex_buffers_dirty)
zink_bind_vertex_buffers<HAS_DYNAMIC_STATE>(batch, ctx);

View File

@ -293,6 +293,7 @@ zink_bind_blend_state(struct pipe_context *pctx, void *cso)
if (state->blend_state != cso) {
state->blend_state = cso;
state->dirty = true;
zink_context(pctx)->blend_state_changed = true;
}
}