}
}
-static enum isl_aux_usage
-fast_clear_aux_usage(const struct anv_image *image,
- VkImageAspectFlagBits aspect)
-{
- uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
- if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE)
- return ISL_AUX_USAGE_CCS_D;
- else
- return image->planes[plane].aux_usage;
-}
-
void
anv_image_copy_to_shadow(struct anv_cmd_buffer *cmd_buffer,
const struct anv_image *image,
struct blorp_surf surf;
get_blorp_surf_for_anv_image(cmd_buffer->device, image, aspect,
0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX,
- fast_clear_aux_usage(image, aspect),
+ image->planes[plane].aux_usage,
&surf);
/* Blorp will store the clear color for us if we provide the clear color
&image->planes[plane].surface.isl,
&image->planes[plane].aux_surface.isl);
assert(ok);
- add_surface(image, &image->planes[plane].aux_surface, plane);
image->planes[plane].aux_usage = ISL_AUX_USAGE_HIZ;
+ add_surface(image, &image->planes[plane].aux_surface, plane);
}
} else if ((aspect & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) && image->samples == 1) {
/* TODO: Disallow compression with :
"Gen12+. Not allocating a CCS buffer.");
image->planes[plane].aux_surface.isl.size_B = 0;
return VK_SUCCESS;
+ } else {
+ image->planes[plane].aux_usage = ISL_AUX_USAGE_CCS_D;
}
add_surface(image, &image->planes[plane].aux_surface, plane);
&image->planes[plane].surface.isl,
&image->planes[plane].aux_surface.isl);
if (ok) {
+ image->planes[plane].aux_usage = ISL_AUX_USAGE_MCS;
add_surface(image, &image->planes[plane].aux_surface, plane);
add_aux_state_tracking_buffer(image, plane, dev);
- image->planes[plane].aux_usage = ISL_AUX_USAGE_MCS;
}
}
*/
assert(image->planes[plane].aux_usage == ISL_AUX_USAGE_HIZ);
return ISL_AUX_STATE_AUX_INVALID;
- } else if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE) {
+ } else if (image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_D) {
return ISL_AUX_STATE_PASS_THROUGH;
} else {
- assert(image->planes[plane].aux_usage != ISL_AUX_USAGE_CCS_D);
return ISL_AUX_STATE_COMPRESSED_CLEAR;
}
return ISL_AUX_STATE_COMPRESSED_CLEAR;
else
return ISL_AUX_STATE_RESOLVED;
- } else if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE) {
+ } else if (image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_D) {
return ISL_AUX_STATE_PASS_THROUGH;
} else {
return ISL_AUX_STATE_COMPRESSED_CLEAR;
assert(aspect & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV);
/* fall-through */
case VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL_KHR:
- if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE) {
- assert(image->samples == 1);
+ if (image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_D) {
return ISL_AUX_STATE_PARTIAL_CLEAR;
} else {
- assert(image->planes[plane].aux_usage != ISL_AUX_USAGE_CCS_D);
return ISL_AUX_STATE_COMPRESSED_CLEAR;
}
case ISL_AUX_STATE_PARTIAL_CLEAR:
assert(image->aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV);
- assert(image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE);
+ assert(image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_D);
assert(image->samples == 1);
return ISL_AUX_USAGE_CCS_D;
struct anv_surface shadow_surface;
/**
- * For color images, this is the aux usage for this image when not used
- * as a color attachment.
- *
- * For depth/stencil images, this is set to ISL_AUX_USAGE_HIZ if the
- * image has a HiZ buffer.
+ * The base aux usage for this image. For color images, this can be
+ * either CCS_E or CCS_D depending on whether or not we can reliably
+ * leave CCS on all the time.
*/
enum isl_aux_usage aux_usage;