Module: Mesa Branch: master Commit: c2a41028485d5ca0a67a4396ac7d8e491c688109 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c2a41028485d5ca0a67a4396ac7d8e491c688109
Author: Sagar Ghuge <[email protected]> Date: Mon Oct 12 19:12:39 2020 -0700 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 <[email protected]> Reviewed-by: Nanley Chery <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2942> --- src/intel/vulkan/anv_private.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index d8fc8014efa..2dc69e690fe 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -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 _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
