Mesa (master): anv: Drop anv_image.c:get_surface()
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Feb 19 20:03:18 UTC 2020
Module: Mesa
Branch: master
Commit: d8fe9e045f0ea24fe869c980fe4b56f4fb9437ab
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8fe9e045f0ea24fe869c980fe4b56f4fb9437ab
Author: Chad Versace <chad at kiwitree.net>
Date: Wed Feb 19 11:05:37 2020 -0800
anv: Drop anv_image.c:get_surface()
It was called exactly once, and even there it returned the wrong surface
in a corner case.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3882>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3882>
---
src/intel/vulkan/anv_image.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 83dcdb18668..fbb14cc996b 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -125,13 +125,6 @@ choose_isl_tiling_flags(const struct anv_image_create_info *anv_info,
return flags;
}
-static struct anv_surface *
-get_surface(struct anv_image *image, VkImageAspectFlagBits aspect)
-{
- uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
- return &image->planes[plane].surface;
-}
-
static void
add_surface(struct anv_image *image, struct anv_surface *surf, uint32_t plane)
{
@@ -1025,10 +1018,13 @@ void anv_GetImageSubresourceLayout(
const struct anv_surface *surface;
if (subresource->aspectMask == VK_IMAGE_ASPECT_PLANE_1_BIT &&
image->drm_format_mod != DRM_FORMAT_MOD_INVALID &&
- isl_drm_modifier_has_aux(image->drm_format_mod))
+ isl_drm_modifier_has_aux(image->drm_format_mod)) {
surface = &image->planes[0].aux_surface;
- else
- surface = get_surface(image, subresource->aspectMask);
+ } else {
+ uint32_t plane = anv_image_aspect_to_plane(image->aspects,
+ subresource->aspectMask);
+ surface = &image->planes[plane].surface;
+ }
assert(__builtin_popcount(subresource->aspectMask) == 1);
More information about the mesa-commit
mailing list