radeonsi: move barriers out of si_execute_clears
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31291>
This commit is contained in:
@@ -1202,7 +1202,9 @@ bool si_msaa_resolve_blit_via_CB(struct pipe_context *ctx, const struct pipe_bli
|
||||
if (!vi_dcc_get_clear_info(sctx, dst, info->dst.level, DCC_UNCOMPRESSED, &clear_info))
|
||||
return false;
|
||||
|
||||
si_execute_clears(sctx, &clear_info, 1, SI_CLEAR_TYPE_DCC, info->render_condition_enable);
|
||||
si_barrier_before_image_fast_clear(sctx, SI_CLEAR_TYPE_DCC);
|
||||
si_execute_clears(sctx, &clear_info, 1, info->render_condition_enable);
|
||||
si_barrier_after_image_fast_clear(sctx);
|
||||
dst->dirty_level_mask &= ~(1 << info->dst.level);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,12 +49,9 @@ static void si_init_clear_image_dcc_single(struct si_clear_info *info, struct si
|
||||
}
|
||||
|
||||
void si_execute_clears(struct si_context *sctx, struct si_clear_info *info,
|
||||
unsigned num_clears, unsigned types, bool render_condition_enable)
|
||||
unsigned num_clears, bool render_condition_enable)
|
||||
{
|
||||
if (!num_clears)
|
||||
return;
|
||||
|
||||
si_barrier_before_image_fast_clear(sctx, types);
|
||||
assert(num_clears);
|
||||
|
||||
/* Execute clears. */
|
||||
for (unsigned i = 0; i < num_clears; i++) {
|
||||
@@ -83,8 +80,6 @@ void si_execute_clears(struct si_context *sctx, struct si_clear_info *info,
|
||||
render_condition_enable);
|
||||
}
|
||||
}
|
||||
|
||||
si_barrier_after_image_fast_clear(sctx);
|
||||
}
|
||||
|
||||
static bool si_alloc_separate_cmask(struct si_screen *sscreen, struct si_texture *tex)
|
||||
@@ -1093,7 +1088,11 @@ static void si_fast_clear(struct si_context *sctx, unsigned *buffers,
|
||||
}
|
||||
}
|
||||
|
||||
si_execute_clears(sctx, info, num_clears, clear_types, sctx->render_cond_enabled);
|
||||
if (num_clears) {
|
||||
si_barrier_before_image_fast_clear(sctx, clear_types);
|
||||
si_execute_clears(sctx, info, num_clears, sctx->render_cond_enabled);
|
||||
si_barrier_after_image_fast_clear(sctx);
|
||||
}
|
||||
}
|
||||
|
||||
static void si_fb_clear_via_compute(struct si_context *sctx, unsigned *buffers,
|
||||
@@ -1397,7 +1396,9 @@ bool si_compute_fast_clear_image(struct si_context *sctx, struct pipe_resource *
|
||||
}
|
||||
|
||||
assert(num_clears <= ARRAY_SIZE(info));
|
||||
si_execute_clears(sctx, info, num_clears, clear_types, render_condition_enable);
|
||||
si_barrier_before_image_fast_clear(sctx, clear_types);
|
||||
si_execute_clears(sctx, info, num_clears, render_condition_enable);
|
||||
si_barrier_after_image_fast_clear(sctx);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1469,7 +1469,7 @@ void si_init_buffer_clear(struct si_clear_info *info,
|
||||
struct pipe_resource *resource, uint64_t offset,
|
||||
uint32_t size, uint32_t clear_value);
|
||||
void si_execute_clears(struct si_context *sctx, struct si_clear_info *info,
|
||||
unsigned num_clears, unsigned types, bool render_condition_enabled);
|
||||
unsigned num_clears, bool render_condition_enabled);
|
||||
bool si_compute_fast_clear_image(struct si_context *sctx, struct pipe_resource *tex,
|
||||
enum pipe_format format, unsigned level, const struct pipe_box *box,
|
||||
const union pipe_color_union *color, bool render_condition_enable,
|
||||
|
||||
@@ -1280,8 +1280,11 @@ static struct si_texture *si_texture_create_object(struct pipe_screen *screen,
|
||||
|
||||
/* Execute the clears. */
|
||||
if (num_clears) {
|
||||
si_execute_clears(si_get_aux_context(&sscreen->aux_context.general), clears, num_clears, 0,
|
||||
false);
|
||||
struct si_context *sctx = si_get_aux_context(&sscreen->aux_context.general);
|
||||
|
||||
si_barrier_before_image_fast_clear(sctx, 0);
|
||||
si_execute_clears(sctx, clears, num_clears, false);
|
||||
si_barrier_after_image_fast_clear(sctx);
|
||||
si_put_aux_context_flush(&sscreen->aux_context.general);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user