get_blorp_surf_for_anv_image(const struct anv_device *device,
const struct anv_image *image,
VkImageAspectFlags aspect,
+ VkImageUsageFlags usage,
VkImageLayout layout,
enum isl_aux_usage aux_usage,
struct blorp_surf *blorp_surf)
{
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
- if (layout != ANV_IMAGE_LAYOUT_EXPLICIT_AUX)
- aux_usage = anv_layout_to_aux_usage(&device->info, image, aspect, layout);
+ if (layout != ANV_IMAGE_LAYOUT_EXPLICIT_AUX) {
+ assert(usage != 0);
+ aux_usage = anv_layout_to_aux_usage(&device->info, image,
+ aspect, usage, layout);
+ }
const struct anv_surface *surface = &image->planes[plane].surface;
*blorp_surf = (struct blorp_surf) {
struct blorp_surf src_surf, dst_surf;
get_blorp_surf_for_anv_image(cmd_buffer->device,
src_image, 1UL << aspect_bit,
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT,
srcImageLayout, ISL_AUX_USAGE_NONE,
&src_surf);
get_blorp_surf_for_anv_image(cmd_buffer->device,
dst_image, 1UL << aspect_bit,
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT,
dstImageLayout, ISL_AUX_USAGE_NONE,
&dst_surf);
anv_cmd_buffer_mark_image_written(cmd_buffer, dst_image,
} else {
struct blorp_surf src_surf, dst_surf;
get_blorp_surf_for_anv_image(cmd_buffer->device, src_image, src_mask,
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT,
srcImageLayout, ISL_AUX_USAGE_NONE,
&src_surf);
get_blorp_surf_for_anv_image(cmd_buffer->device, dst_image, dst_mask,
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT,
dstImageLayout, ISL_AUX_USAGE_NONE,
&dst_surf);
anv_cmd_buffer_mark_image_written(cmd_buffer, dst_image, dst_mask,
const VkImageAspectFlags aspect = pRegions[r].imageSubresource.aspectMask;
get_blorp_surf_for_anv_image(cmd_buffer->device, anv_image, aspect,
+ buffer_to_image ?
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT :
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT,
image_layout, ISL_AUX_USAGE_NONE,
&image.surf);
image.offset =
anv_foreach_image_aspect_bit(aspect_bit, src_image, src_res->aspectMask) {
get_blorp_surf_for_anv_image(cmd_buffer->device,
src_image, 1U << aspect_bit,
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT,
srcImageLayout, ISL_AUX_USAGE_NONE, &src);
get_blorp_surf_for_anv_image(cmd_buffer->device,
dst_image, 1U << aspect_bit,
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT,
dstImageLayout, ISL_AUX_USAGE_NONE, &dst);
struct anv_format_plane src_format =
struct blorp_surf surf;
get_blorp_surf_for_anv_image(cmd_buffer->device,
image, pRanges[r].aspectMask,
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT,
imageLayout, ISL_AUX_USAGE_NONE, &surf);
struct anv_format_plane src_format =
if (image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT) {
get_blorp_surf_for_anv_image(cmd_buffer->device,
image, VK_IMAGE_ASPECT_DEPTH_BIT,
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT,
imageLayout, ISL_AUX_USAGE_NONE, &depth);
} else {
memset(&depth, 0, sizeof(depth));
if (image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
get_blorp_surf_for_anv_image(cmd_buffer->device,
image, VK_IMAGE_ASPECT_STENCIL_BIT,
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT,
imageLayout, ISL_AUX_USAGE_NONE, &stencil);
has_stencil_shadow =
struct blorp_surf src_surf, dst_surf;
get_blorp_surf_for_anv_image(cmd_buffer->device, src_image, aspect,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
src_aux_usage, &src_surf);
if (src_aux_usage == ISL_AUX_USAGE_MCS) {
src_surf.clear_color_addr = anv_to_blorp_address(
VK_IMAGE_ASPECT_COLOR_BIT));
}
get_blorp_surf_for_anv_image(cmd_buffer->device, dst_image, aspect,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
dst_aux_usage, &dst_surf);
anv_cmd_buffer_mark_image_written(cmd_buffer, dst_image,
aspect, dst_aux_usage,
pRegions[r].srcSubresource.aspectMask) {
enum isl_aux_usage src_aux_usage =
anv_layout_to_aux_usage(&cmd_buffer->device->info, src_image,
- (1 << aspect_bit), srcImageLayout);
+ (1 << aspect_bit),
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT,
+ srcImageLayout);
enum isl_aux_usage dst_aux_usage =
anv_layout_to_aux_usage(&cmd_buffer->device->info, dst_image,
- (1 << aspect_bit), dstImageLayout);
+ (1 << aspect_bit),
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT,
+ dstImageLayout);
anv_image_msaa_resolve(cmd_buffer,
src_image, src_aux_usage,
struct blorp_surf surf;
get_blorp_surf_for_anv_image(cmd_buffer->device,
image, aspect,
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT,
VK_IMAGE_LAYOUT_GENERAL,
ISL_AUX_USAGE_NONE, &surf);
assert(surf.aux_usage == ISL_AUX_USAGE_NONE);
struct blorp_surf surf;
get_blorp_surf_for_anv_image(cmd_buffer->device, image, aspect,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
aux_usage, &surf);
anv_cmd_buffer_mark_image_written(cmd_buffer, image, aspect, aux_usage,
level, base_layer, layer_count);
if (aspects & VK_IMAGE_ASPECT_DEPTH_BIT) {
get_blorp_surf_for_anv_image(cmd_buffer->device,
image, VK_IMAGE_ASPECT_DEPTH_BIT,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
depth_aux_usage, &depth);
depth.clear_color.f32[0] = ANV_HZ_FC_VAL;
}
if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
get_blorp_surf_for_anv_image(cmd_buffer->device,
image, VK_IMAGE_ASPECT_STENCIL_BIT,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
ISL_AUX_USAGE_NONE, &stencil);
}
struct blorp_surf surf;
get_blorp_surf_for_anv_image(cmd_buffer->device,
image, VK_IMAGE_ASPECT_DEPTH_BIT,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
ISL_AUX_USAGE_HIZ, &surf);
surf.clear_color.f32[0] = ANV_HZ_FC_VAL;
anv_image_aux_layers(image, VK_IMAGE_ASPECT_DEPTH_BIT, level));
get_blorp_surf_for_anv_image(cmd_buffer->device,
image, VK_IMAGE_ASPECT_DEPTH_BIT,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
ISL_AUX_USAGE_HIZ, &depth);
depth.clear_color.f32[0] = ANV_HZ_FC_VAL;
}
if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
get_blorp_surf_for_anv_image(cmd_buffer->device,
image, VK_IMAGE_ASPECT_STENCIL_BIT,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
ISL_AUX_USAGE_NONE, &stencil);
}
struct blorp_surf surf;
get_blorp_surf_for_anv_image(cmd_buffer->device, image, aspect,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
ISL_AUX_USAGE_MCS, &surf);
/* Blorp will store the clear color for us if we provide the clear color
struct blorp_surf surf;
get_blorp_surf_for_anv_image(cmd_buffer->device, image, aspect,
- ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
+ 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
fast_clear_aux_usage(image, aspect),
&surf);
att_state->aux_usage =
anv_layout_to_aux_usage(&device->info, iview->image,
VK_IMAGE_ASPECT_COLOR_BIT,
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
/* If we don't have aux, then we should have returned early in the layer
const enum isl_aux_usage first_subpass_aux_usage =
anv_layout_to_aux_usage(&device->info, iview->image,
VK_IMAGE_ASPECT_DEPTH_BIT,
+ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
pass_att->first_subpass_layout);
if (!blorp_can_hiz_clear_depth(&device->info,
&iview->image->planes[0].surface.isl,
}
const enum isl_aux_usage initial_aux_usage =
- anv_layout_to_aux_usage(devinfo, image, aspect, initial_layout);
+ anv_layout_to_aux_usage(devinfo, image, aspect, 0, initial_layout);
const enum isl_aux_usage final_aux_usage =
- anv_layout_to_aux_usage(devinfo, image, aspect, final_layout);
+ anv_layout_to_aux_usage(devinfo, image, aspect, 0, final_layout);
/* The current code assumes that there is no mixing of CCS_E and CCS_D.
* We can handle transitions between CCS_D/E to and from NONE. What we
enum isl_aux_usage aux_usage =
anv_layout_to_aux_usage(&cmd_buffer->device->info, iview->image,
- VK_IMAGE_ASPECT_DEPTH_BIT, layout);
+ VK_IMAGE_ASPECT_DEPTH_BIT,
+ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
+ layout);
cmd_buffer->state.hiz_enabled = aux_usage == ISL_AUX_USAGE_HIZ;
}
att_state->current_layout, target_layout);
att_state->aux_usage =
anv_layout_to_aux_usage(&cmd_buffer->device->info, image,
- VK_IMAGE_ASPECT_DEPTH_BIT, target_layout);
+ VK_IMAGE_ASPECT_DEPTH_BIT,
+ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
+ target_layout);
}
if (image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT) {
src_state->aux_usage =
anv_layout_to_aux_usage(&cmd_buffer->device->info, src_iview->image,
VK_IMAGE_ASPECT_DEPTH_BIT,
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
src_state->current_layout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
dst_state->aux_usage =
anv_layout_to_aux_usage(&cmd_buffer->device->info, dst_iview->image,
VK_IMAGE_ASPECT_DEPTH_BIT,
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
dst_state->current_layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;