tu: Do not re-calculate static blend LRZ state

If blend LRZ state was already calculated from static info,
re-calculating it with dynamic state would bring stale values
and therefor result in a wrong calculations.

This resulted in LRZ being disabled when it should have not in
native VK titles.

CC: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32868>
This commit is contained in:
Danylo Piliaiev 2025-01-03 14:17:19 +01:00 committed by Marge Bot
parent 20cb4eeba6
commit 7dee7956f2

View file

@ -3785,9 +3785,8 @@ tu_emit_draw_state(struct tu_cmd_buffer *cmd)
cmd->vk.dynamic_graphics_state.ms.alpha_to_coverage_enable,
cmd->vk.dynamic_graphics_state.ms.alpha_to_one_enable,
cmd->vk.dynamic_graphics_state.ms.sample_mask);
if (EMIT_STATE(blend_lrz) ||
((cmd->state.dirty & TU_CMD_DIRTY_SUBPASS) &&
!cmd->state.pipeline_blend_lrz)) {
if (!cmd->state.pipeline_blend_lrz &&
(EMIT_STATE(blend_lrz) || (cmd->state.dirty & TU_CMD_DIRTY_SUBPASS))) {
bool blend_reads_dest = tu6_calc_blend_lrz(&cmd->vk.dynamic_graphics_state.cb,
&cmd->state.vk_rp);
if (blend_reads_dest != cmd->state.blend_reads_dest) {
@ -3795,9 +3794,8 @@ tu_emit_draw_state(struct tu_cmd_buffer *cmd)
cmd->state.dirty |= TU_CMD_DIRTY_LRZ;
}
}
if (EMIT_STATE(bandwidth) ||
((cmd->state.dirty & TU_CMD_DIRTY_SUBPASS) &&
!cmd->state.pipeline_bandwidth))
if (!cmd->state.pipeline_bandwidth &&
(EMIT_STATE(bandwidth) || (cmd->state.dirty & TU_CMD_DIRTY_SUBPASS)))
tu_calc_bandwidth(&cmd->state.bandwidth, &cmd->vk.dynamic_graphics_state.cb,
&cmd->state.vk_rp);
DRAW_STATE(blend_constants, VK_DYNAMIC_STATE_BLEND_CONSTANTS,