iris: Create BLORP surfaces after resource preparation

iris_resource_prepare_render will soon gain the ability to change a
resource's clear color. iris_blorp_surf_for_resource will keep a copy of
that clear color, so make sure calls to it happen after the render
preparation helper. At the moment, this shouldn't have an impact besides
improving debugging.

While we're here, do the same for the generic access preparation helper.
We may convert those to more specific helpers at a later time.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23676>
This commit is contained in:
Nanley Chery 2023-06-07 15:49:31 -04:00 committed by Marge Bot
parent 215b50ace1
commit 1aa4e6bac0

View file

@ -508,6 +508,12 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
iris_resource_render_aux_usage(ice, dst_res, dst_fmt.fmt,
info->dst.level, false);
iris_resource_prepare_render(ice, dst_res, dst_fmt.fmt, info->dst.level,
info->dst.box.z, info->dst.box.depth,
dst_aux_usage);
iris_emit_buffer_barrier_for(batch, dst_res->bo,
IRIS_DOMAIN_RENDER_WRITE);
struct blorp_surf src_surf, dst_surf;
iris_blorp_surf_for_resource(&screen->isl_dev, &src_surf,
&src_res->base.b, src_aux_usage,
@ -516,12 +522,6 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
&dst_res->base.b, dst_aux_usage,
info->dst.level, true);
iris_resource_prepare_render(ice, dst_res, dst_fmt.fmt, info->dst.level,
info->dst.box.z, info->dst.box.depth,
dst_aux_usage);
iris_emit_buffer_barrier_for(batch, dst_res->bo,
IRIS_DOMAIN_RENDER_WRITE);
if (iris_batch_references(batch, src_res->bo))
tex_cache_flush_hack(batch, src_fmt.fmt, src_res->surf.format);
@ -730,12 +730,6 @@ iris_copy_region(struct blorp_context *blorp,
} else {
// XXX: what about one surface being a buffer and not the other?
struct blorp_surf src_surf, dst_surf;
iris_blorp_surf_for_resource(&screen->isl_dev, &src_surf,
src, src_aux_usage, src_level, false);
iris_blorp_surf_for_resource(&screen->isl_dev, &dst_surf,
dst, dst_aux_usage, dst_level, true);
iris_resource_prepare_access(ice, src_res, src_level, 1,
src_box->z, src_box->depth,
src_aux_usage, src_clear_supported);
@ -747,6 +741,12 @@ iris_copy_region(struct blorp_context *blorp,
IRIS_DOMAIN_SAMPLER_READ);
iris_emit_buffer_barrier_for(batch, dst_res->bo, write_domain);
struct blorp_surf src_surf, dst_surf;
iris_blorp_surf_for_resource(&screen->isl_dev, &src_surf,
src, src_aux_usage, src_level, false);
iris_blorp_surf_for_resource(&screen->isl_dev, &dst_surf,
dst, dst_aux_usage, dst_level, true);
for (int slice = 0; slice < src_box->depth; slice++) {
iris_batch_maybe_flush(batch, 1500);