mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
radv: ignore dual-source blending when blending isn't enabled for MRT0
The Vulkan spec says:
"VUID-vkCmdDraw-maxFragmentDualSrcAttachments-09239
If blending is enabled for any attachment where either the source
or destination blend factors for that attachment use the secondary
color input, the maximum value of Location for any output attachment
statically used in the Fragment Execution Model executed by this
command must be less than maxFragmentDualSrcAttachments"
Which means it must be disabled.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14190
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
(cherry picked from commit b2badb2b24)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38268>
This commit is contained in:
parent
770e095766
commit
f69d1abfcf
2 changed files with 10 additions and 3 deletions
|
|
@ -234,7 +234,7 @@
|
|||
"description": "radv: ignore dual-source blending when blending isn't enabled for MRT0",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -6111,6 +6111,13 @@ radv_emit_tess_domain_origin_state(struct radv_cmd_buffer *cmd_buffer)
|
|||
radeon_end();
|
||||
}
|
||||
|
||||
static bool
|
||||
radv_is_dual_src_enabled(const struct radv_dynamic_state *dynamic_state)
|
||||
{
|
||||
/* Dual-source blending must be ignored if blending isn't enabled for MRT0. */
|
||||
return dynamic_state->blend_eq.mrt0_is_dual_src && !!(dynamic_state->color_blend_enable & 1u);
|
||||
}
|
||||
|
||||
static struct radv_shader_part *
|
||||
lookup_ps_epilog(struct radv_cmd_buffer *cmd_buffer)
|
||||
{
|
||||
|
|
@ -6144,7 +6151,7 @@ lookup_ps_epilog(struct radv_cmd_buffer *cmd_buffer)
|
|||
|
||||
state.color_write_mask = d->color_write_mask;
|
||||
state.color_blend_enable = d->color_blend_enable;
|
||||
state.mrt0_is_dual_src = d->blend_eq.mrt0_is_dual_src;
|
||||
state.mrt0_is_dual_src = radv_is_dual_src_enabled(&cmd_buffer->state.dynamic);
|
||||
|
||||
if (d->vk.ms.alpha_to_coverage_enable) {
|
||||
/* Select a color export format with alpha when alpha to coverage is enabled. */
|
||||
|
|
@ -11689,7 +11696,7 @@ radv_emit_cb_render_state(struct radv_cmd_buffer *cmd_buffer)
|
|||
const struct radv_rendering_state *render = &cmd_buffer->state.render;
|
||||
const struct radv_dynamic_state *d = &cmd_buffer->state.dynamic;
|
||||
unsigned cb_blend_control[MAX_RTS], sx_mrt_blend_opt[MAX_RTS];
|
||||
const bool mrt0_is_dual_src = d->blend_eq.mrt0_is_dual_src;
|
||||
const bool mrt0_is_dual_src = radv_is_dual_src_enabled(&cmd_buffer->state.dynamic);
|
||||
uint32_t cb_color_control = 0;
|
||||
|
||||
const uint32_t cb_target_mask = d->color_write_enable & d->color_write_mask;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue