const struct anv_device *device)
{
assert(image && device);
- assert(image->planes[plane].aux_surface.isl.size_B > 0 &&
+ assert(image->planes[plane].aux_usage != ISL_AUX_USAGE_NONE &&
image->aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV);
/* Compressed images must be tiled and therefore everything should be 4K
image->planes[plane].surface.isl.size_B)) <=
(image->planes[plane].offset + image->planes[plane].size));
- if (image->planes[plane].aux_surface.isl.size_B) {
+ if (image->planes[plane].aux_usage != ISL_AUX_USAGE_NONE) {
/* assert(image->planes[plane].fast_clear_state_offset == */
/* (image->planes[plane].aux_surface.offset + image->planes[plane].aux_surface.isl.size_B)); */
assert(image->planes[plane].fast_clear_state_offset <
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
/* If we don't have an aux buffer then aux state makes no sense */
- assert(image->planes[plane].aux_surface.isl.size_B > 0);
+ assert(image->planes[plane].aux_usage != ISL_AUX_USAGE_NONE);
/* All images that use an auxiliary surface are required to be tiled. */
assert(image->planes[plane].surface.isl.tiling != ISL_TILING_LINEAR);
/* If there is no auxiliary surface allocated, we must use the one and only
* main buffer.
*/
- if (image->planes[plane].aux_surface.isl.size_B == 0)
+ if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE)
return ISL_AUX_USAGE_NONE;
enum isl_aux_state aux_state =
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
/* If there is no auxiliary surface allocated, there are no fast-clears */
- if (image->planes[plane].aux_surface.isl.size_B == 0)
+ if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE)
return ANV_FAST_CLEAR_NONE;
/* We don't support MSAA fast-clears on Ivybridge or Bay Trail because they
VkImageAspectFlagBits aspect)
{
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
+ if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE)
+ return 0;
/* The Gen12 CCS aux surface is represented with only one level. */
- const uint8_t aux_logical_levels =
- image->planes[plane].aux_surface.isl.tiling == ISL_TILING_GEN12_CCS ?
- image->planes[plane].surface.isl.levels :
- image->planes[plane].aux_surface.isl.levels;
-
- return image->planes[plane].aux_surface.isl.size_B > 0 ?
- aux_logical_levels : 0;
+ return image->planes[plane].aux_surface.isl.tiling == ISL_TILING_GEN12_CCS ?
+ image->planes[plane].surface.isl.levels :
+ image->planes[plane].aux_surface.isl.levels;
}
/* Returns the number of auxiliary buffer layers attached to an image. */
if (GEN_GEN < 10 &&
(att_state->pending_load_aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) &&
- image->planes[0].aux_surface.isl.size_B > 0 &&
+ image->planes[0].aux_usage != ISL_AUX_USAGE_NONE &&
iview->planes[0].isl.base_level == 0 &&
iview->planes[0].isl.base_array_layer == 0) {
if (att_state->aux_usage != ISL_AUX_USAGE_NONE) {