radeonsi: restructure fb_barrier code in si_launch_grid

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31193>
This commit is contained in:
Marek Olšák
2024-08-23 17:02:24 -04:00
committed by Marge Bot
parent 895226e3ab
commit dad0e0131b
+8 -5
View File
@@ -1187,19 +1187,22 @@ static void si_launch_grid(struct pipe_context *ctx, const struct pipe_grid_info
if (sctx->has_graphics) {
if (sctx->num_draw_calls_sh_coherent.with_cb != sctx->num_draw_calls ||
sctx->num_draw_calls_sh_coherent.with_db != sctx->num_draw_calls) {
bool sync_cb = sctx->force_shader_coherency.with_cb ||
si_check_needs_implicit_sync(sctx, RADEON_USAGE_CB_NEEDS_IMPLICIT_SYNC);
bool sync_db = sctx->gfx_level == GFX12 &&
(sctx->force_shader_coherency.with_db ||
si_check_needs_implicit_sync(sctx, RADEON_USAGE_DB_NEEDS_IMPLICIT_SYNC));
si_fb_barrier_after_rendering(sctx);
if (sctx->force_shader_coherency.with_cb ||
si_check_needs_implicit_sync(sctx, RADEON_USAGE_CB_NEEDS_IMPLICIT_SYNC)) {
if (sync_cb) {
sctx->num_draw_calls_sh_coherent.with_cb = sctx->num_draw_calls;
si_make_CB_shader_coherent(sctx, 0,
sctx->framebuffer.CB_has_shader_readable_metadata,
sctx->framebuffer.all_DCC_pipe_aligned);
}
if (sctx->gfx_level == GFX12 &&
(sctx->force_shader_coherency.with_db ||
si_check_needs_implicit_sync(sctx, RADEON_USAGE_DB_NEEDS_IMPLICIT_SYNC))) {
if (sync_db) {
sctx->num_draw_calls_sh_coherent.with_db = sctx->num_draw_calls;
si_make_DB_shader_coherent(sctx, 0, false, false);
}