mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-19 23:10:47 +02:00
anv: Always disable Color Blending for unused Render Targets
Commitd2f7b6d5changed the BLEND_STATE update process so that only the used render targets will be updated. This mostly works fine, but in cases when the Dual Source Blending was used previously, we still must turn it off to avoid the undefined behavior that leads to hangs. Fixes:d2f7b6d5("anv: implement VK_KHR_dynamic_rendering_local_read") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13675 Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37246>
This commit is contained in:
parent
f3c3b99e60
commit
b148d47c3e
1 changed files with 12 additions and 1 deletions
|
|
@ -1708,8 +1708,19 @@ update_blend_state(struct anv_gfx_dynamic_state *hw_state,
|
|||
bool alpha_blend_zero = false;
|
||||
uint32_t rt_0 = MESA_VK_ATTACHMENT_UNUSED;
|
||||
for (uint32_t rt = 0; rt < MAX_RTS; rt++) {
|
||||
if (gfx->color_output_mapping[rt] >= gfx->color_att_count)
|
||||
if (gfx->color_output_mapping[rt] >= gfx->color_att_count) {
|
||||
/* The Dual Source Blending documentation says:
|
||||
*
|
||||
* "If SRC1 is included in a src/dst blend factor and a DualSource RT
|
||||
* Write message is not used, results are UNDEFINED."
|
||||
*
|
||||
* In practice, this results in hangs if we leave the Dual Source
|
||||
* Blending enabled for the unused render targets. The easiest way to
|
||||
* avoid it altogether is to completely disable the blending for them.
|
||||
*/
|
||||
SET(BLEND_STATE, blend.rts[rt].ColorBufferBlendEnable, false);
|
||||
continue;
|
||||
}
|
||||
|
||||
uint32_t att = gfx->color_output_mapping[rt];
|
||||
if (att == 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue