mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20799>
(cherry picked from commit b4d18f2ad1)
This commit is contained in:
parent
3b5dfeda81
commit
95961596d4
4 changed files with 2 additions and 27 deletions
|
|
@ -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
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -318,7 +318,6 @@ struct zink_blend_state {
|
|||
VkBool32 alpha_to_coverage;
|
||||
VkBool32 alpha_to_one;
|
||||
|
||||
bool need_blend_constants;
|
||||
bool dual_src_blend;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue