For clear/blits ccu flush not only worse for perf, but also messes up
flush_bits when executed in a conditional set of commands.
We already don't flush for 3d blits.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6419
Fixes:
487aa807bd1b70602fcb6fbdabd101d4cff7c07b
("tu: Rewrite flushing to use barriers")
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16352>
{
assert(samples == VK_SAMPLE_COUNT_1_BIT);
- tu_emit_cache_flush_ccu(cmd, cs, TU_CMD_CCU_SYSMEM);
+ if (!cmd->state.pass) {
+ tu_emit_cache_flush_ccu(cmd, cs, TU_CMD_CCU_SYSMEM);
+ }
r2d_setup_common(cmd, cs, format, aspect_mask, blit_param, clear, ubwc, false);
}
enum tu_cmd_flush_bits flushes = cmd_buffer->state.cache.flush_bits;
assert(ccu_state != TU_CMD_CCU_UNKNOWN);
+ /* It's unsafe to flush inside condition because we clear flush_bits */
+ assert(!cs->cond_flags);
/* Changing CCU state must involve invalidating the CCU. In sysmem mode,
* the CCU may also contain data that we haven't flushed out yet, so we