diff --git a/src/intel/blorp/blorp.h b/src/intel/blorp/blorp.h index 3d29d1617d0..2d01fbcb0da 100644 --- a/src/intel/blorp/blorp.h +++ b/src/intel/blorp/blorp.h @@ -148,14 +148,22 @@ void blorp_batch_init(struct blorp_context *blorp, struct blorp_batch *batch, void blorp_batch_finish(struct blorp_batch *batch); static inline isl_surf_usage_flags_t -blorp_batch_isl_copy_usage(const struct blorp_batch *batch, bool is_dest) +blorp_batch_isl_copy_usage(const struct blorp_batch *batch, bool is_dest, + bool _protected) { + isl_surf_usage_flags_t usage; + if (batch->flags & BLORP_BATCH_USE_COMPUTE) - return is_dest ? ISL_SURF_USAGE_STORAGE_BIT : ISL_SURF_USAGE_TEXTURE_BIT; + usage = is_dest ? ISL_SURF_USAGE_STORAGE_BIT : ISL_SURF_USAGE_TEXTURE_BIT; else if (batch->flags & BLORP_BATCH_USE_BLITTER) - return is_dest ? ISL_SURF_USAGE_BLITTER_DST_BIT : ISL_SURF_USAGE_BLITTER_SRC_BIT; + usage = is_dest ? ISL_SURF_USAGE_BLITTER_DST_BIT : ISL_SURF_USAGE_BLITTER_SRC_BIT; else - return is_dest ? ISL_SURF_USAGE_RENDER_TARGET_BIT : ISL_SURF_USAGE_TEXTURE_BIT; + usage = is_dest ? ISL_SURF_USAGE_RENDER_TARGET_BIT : ISL_SURF_USAGE_TEXTURE_BIT; + + if (_protected) + usage |= ISL_SURF_USAGE_PROTECTED_BIT; + + return usage; } struct blorp_address { diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index 8751dc044be..09f4551af6b 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -1043,13 +1043,15 @@ copy_buffer(struct anv_device *device, .buffer = src_buffer->address.bo, .offset = src_buffer->address.offset + region->srcOffset, .mocs = anv_mocs(device, src_buffer->address.bo, - blorp_batch_isl_copy_usage(batch, false /* is_dest */)), + blorp_batch_isl_copy_usage(batch, false /* is_dest */, + anv_buffer_is_protected(src_buffer))), }; struct blorp_address dst = { .buffer = dst_buffer->address.bo, .offset = dst_buffer->address.offset + region->dstOffset, .mocs = anv_mocs(device, dst_buffer->address.bo, - blorp_batch_isl_copy_usage(batch, true /* is_dest */)), + blorp_batch_isl_copy_usage(batch, true /* is_dest */, + anv_buffer_is_protected(dst_buffer))), }; blorp_buffer_copy(batch, src, dst, region->size);