anv: Return number of layers/levels attached to anv_image
Don't check the auxiliary surface's ISL surf in order to return the surface levels/layers instead we can return the anv_image parameter. Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942>
This commit is contained in:
parent
67956689bb
commit
c2a4102848
|
@ -3870,10 +3870,7 @@ anv_image_aux_levels(const struct anv_image * const image,
|
|||
if (image->planes[plane].aux_usage == ISL_AUX_USAGE_NONE)
|
||||
return 0;
|
||||
|
||||
/* The Gen12 CCS aux surface is represented with only one level. */
|
||||
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;
|
||||
return image->levels;
|
||||
}
|
||||
|
||||
/* Returns the number of auxiliary buffer layers attached to an image. */
|
||||
|
@ -3892,18 +3889,9 @@ anv_image_aux_layers(const struct anv_image * const image,
|
|||
* auxiliary data.
|
||||
*/
|
||||
return 0;
|
||||
} else {
|
||||
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
|
||||
|
||||
/* The Gen12 CCS aux surface is represented with only one layer. */
|
||||
const struct isl_extent4d *aux_logical_level0_px =
|
||||
image->planes[plane].aux_surface.isl.tiling == ISL_TILING_GEN12_CCS ?
|
||||
&image->planes[plane].surface.isl.logical_level0_px :
|
||||
&image->planes[plane].aux_surface.isl.logical_level0_px;
|
||||
|
||||
return MAX2(aux_logical_level0_px->array_len,
|
||||
aux_logical_level0_px->depth >> miplevel);
|
||||
}
|
||||
|
||||
return MAX2(image->array_size, image->extent.depth >> miplevel);
|
||||
}
|
||||
|
||||
static inline struct anv_address
|
||||
|
|
Loading…
Reference in New Issue