aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <chad@kiwitree.net>2020-02-19 11:05:37 -0800
committerChad Versace <chad@kiwitree.net>2020-02-19 11:40:08 -0800
commit19fdd1b2826154a81abfacf9ec8e28401ac76428 (patch)
treee3e59b12b8e4d16f026aa059c1127abea27560aa
parentd46a5cfe781a1f51a1338d994fb8097d9d579d2e (diff)
downloadmesa-anv-cleanup-05.zip
mesa-anv-cleanup-05.tar.xz
anv: Drop anv_image.c:get_surface()anv-cleanup-05
It was called exactly once, and even there it returned the wrong surface in a corner case. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
-rw-r--r--src/intel/vulkan/anv_image.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 83dcdb1..fbb14cc 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);