iris_resource_prepare_access(ice, src_res, info->src.level, 1,
info->src.box.z, info->src.box.depth,
src_aux_usage, src_clear_supported);
+ iris_emit_buffer_barrier_for(batch, src_res->bo, IRIS_DOMAIN_OTHER_READ);
struct iris_format_info dst_fmt =
iris_format_for_usage(devinfo, info->dst.format,
iris_resource_prepare_access(ice, dst_res, info->dst.level, 1,
info->dst.box.z, info->dst.box.depth,
dst_aux_usage, dst_clear_supported);
+ iris_emit_buffer_barrier_for(batch, dst_res->bo, IRIS_DOMAIN_RENDER_WRITE);
float src_x0 = info->src.box.x;
float src_x1 = info->src.box.x + info->src.box.width;
iris_resource_prepare_access(ice, src_res, info->src.level, 1,
info->src.box.z, info->src.box.depth,
stc_src_aux_usage, false);
+ iris_emit_buffer_barrier_for(batch, src_res->bo, IRIS_DOMAIN_OTHER_READ);
iris_resource_prepare_access(ice, stc_dst, info->dst.level, 1,
info->dst.box.z, info->dst.box.depth,
stc_dst_aux_usage, false);
+ iris_emit_buffer_barrier_for(batch, stc_dst->bo, IRIS_DOMAIN_RENDER_WRITE);
iris_blorp_surf_for_resource(&screen->isl_dev, &src_surf,
&src_res->base, stc_src_aux_usage,
info->src.level, false);
.reloc_flags = EXEC_OBJECT_WRITE,
};
+ iris_emit_buffer_barrier_for(batch, iris_resource_bo(src),
+ IRIS_DOMAIN_OTHER_READ);
+ iris_emit_buffer_barrier_for(batch, iris_resource_bo(dst),
+ IRIS_DOMAIN_RENDER_WRITE);
+
iris_batch_maybe_flush(batch, 1500);
iris_batch_sync_region_start(batch);
dstz, src_box->depth,
dst_aux_usage, dst_clear_supported);
+ iris_emit_buffer_barrier_for(batch, iris_resource_bo(src),
+ IRIS_DOMAIN_OTHER_READ);
+ iris_emit_buffer_barrier_for(batch, iris_resource_bo(dst),
+ IRIS_DOMAIN_RENDER_WRITE);
+
blorp_batch_init(&ice->blorp, &blorp_batch, batch, 0);
for (int slice = 0; slice < src_box->depth; slice++) {
PIPE_CONTROL_STALL_AT_SCOREBOARD);
#endif
- /* Flush the sampler and render caches. We definitely need to flush the
- * sampler cache so that we get updated contents from the render cache for
- * the glBlitFramebuffer() source. Also, we are sometimes warned in the
- * docs to flush the cache between reinterpretations of the same surface
- * data with different formats, which blorp does for stencil and depth
- * data.
+ /* Flush the render cache in cases where the same surface is reinterpreted
+ * with a differernt format, which blorp does for stencil and depth data
+ * among other things. Invalidation of sampler caches and flushing of any
+ * caches which had previously written the source surfaces should already
+ * have been handled by the caller.
*/
- if (params->src.enabled)
- iris_emit_buffer_barrier_for(batch, params->src.addr.buffer,
- IRIS_DOMAIN_OTHER_READ);
if (params->dst.enabled) {
iris_cache_flush_for_render(batch, params->dst.addr.buffer,
params->dst.view.format,
params->dst.aux_usage);
}
- if (params->depth.enabled)
- iris_emit_buffer_barrier_for(batch, params->depth.addr.buffer,
- IRIS_DOMAIN_DEPTH_WRITE);
- if (params->stencil.enabled)
- iris_emit_buffer_barrier_for(batch, params->stencil.addr.buffer,
- IRIS_DOMAIN_DEPTH_WRITE);
iris_require_command_space(batch, 1400);
iris_resource_prepare_render(ice, batch, res, level,
box->z, box->depth, aux_usage);
+ iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_RENDER_WRITE);
struct blorp_surf surf;
iris_blorp_surf_for_resource(&batch->screen->isl_dev, &surf,
if (clear_depth && z_res) {
iris_resource_prepare_depth(ice, batch, z_res, level, box->z, box->depth);
+ iris_emit_buffer_barrier_for(batch, z_res->bo, IRIS_DOMAIN_DEPTH_WRITE);
iris_blorp_surf_for_resource(&batch->screen->isl_dev,
&z_surf, &z_res->base, z_res->aux.usage,
level, true);
if (stencil_mask) {
iris_resource_prepare_access(ice, stencil_res, level, 1, box->z,
box->depth, stencil_res->aux.usage, false);
+ iris_emit_buffer_barrier_for(batch, stencil_res->bo,
+ IRIS_DOMAIN_DEPTH_WRITE);
iris_blorp_surf_for_resource(&batch->screen->isl_dev,
&stencil_surf, &stencil_res->base,
stencil_res->aux.usage, level, true);
struct blorp_surf surf;
iris_blorp_surf_for_resource(&batch->screen->isl_dev, &surf,
&res->base, res->aux.usage, 0, true);
+ iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_RENDER_WRITE);
struct blorp_batch blorp_batch;
iris_batch_sync_region_start(batch);