From: Chad Versace Date: Mon, 14 Oct 2019 19:07:23 +0000 (-0700) Subject: anv: Drop unused anv_image_get_surface_for_aspect_mask() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=84b791a4bb1b3eb15b9a820e9a5dc61a373392f3;p=mesa.git anv: Drop unused anv_image_get_surface_for_aspect_mask() Replaced by anv_image.c:get_surface() in: commit a62a97933578a813beb0d27cc8e404850f7fd302 Author: Lionel Landwerlin CommitDate: Fri Oct 6 16:32:20 2017 +0100 Subject: anv: enable multiple planes per image/imageView Reviewed-by: Jason Ekstrand Part-of: --- diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 28db8951534..1f9bc9ab3e8 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -2019,62 +2019,3 @@ anv_DestroyBufferView(VkDevice _device, VkBufferView bufferView, vk_free2(&device->alloc, pAllocator, view); } - -const struct anv_surface * -anv_image_get_surface_for_aspect_mask(const struct anv_image *image, - VkImageAspectFlags aspect_mask) -{ - VkImageAspectFlags sanitized_mask; - - switch (aspect_mask) { - case VK_IMAGE_ASPECT_COLOR_BIT: - assert(image->aspects == VK_IMAGE_ASPECT_COLOR_BIT); - sanitized_mask = VK_IMAGE_ASPECT_COLOR_BIT; - break; - case VK_IMAGE_ASPECT_DEPTH_BIT: - assert(image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT); - sanitized_mask = VK_IMAGE_ASPECT_DEPTH_BIT; - break; - case VK_IMAGE_ASPECT_STENCIL_BIT: - assert(image->aspects & VK_IMAGE_ASPECT_STENCIL_BIT); - sanitized_mask = VK_IMAGE_ASPECT_STENCIL_BIT; - break; - case VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT: - /* FINISHME: The Vulkan spec (git a511ba2) requires support for - * combined depth stencil formats. Specifically, it states: - * - * At least one of ename:VK_FORMAT_D24_UNORM_S8_UINT or - * ename:VK_FORMAT_D32_SFLOAT_S8_UINT must be supported. - * - * Image views with both depth and stencil aspects are only valid for - * render target attachments, in which case - * cmd_buffer_emit_depth_stencil() will pick out both the depth and - * stencil surfaces from the underlying surface. - */ - if (image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT) { - sanitized_mask = VK_IMAGE_ASPECT_DEPTH_BIT; - } else { - assert(image->aspects == VK_IMAGE_ASPECT_STENCIL_BIT); - sanitized_mask = VK_IMAGE_ASPECT_STENCIL_BIT; - } - break; - case VK_IMAGE_ASPECT_PLANE_0_BIT: - assert((image->aspects & ~VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) == 0); - sanitized_mask = VK_IMAGE_ASPECT_PLANE_0_BIT; - break; - case VK_IMAGE_ASPECT_PLANE_1_BIT: - assert((image->aspects & ~VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) == 0); - sanitized_mask = VK_IMAGE_ASPECT_PLANE_1_BIT; - break; - case VK_IMAGE_ASPECT_PLANE_2_BIT: - assert((image->aspects & ~VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) == 0); - sanitized_mask = VK_IMAGE_ASPECT_PLANE_2_BIT; - break; - default: - unreachable("image does not have aspect"); - return NULL; - } - - uint32_t plane = anv_image_aspect_to_plane(image->aspects, sanitized_mask); - return &image->planes[plane].surface; -} diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index d794a9db5dd..fa5c7cbf2a0 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -3876,10 +3876,6 @@ VkResult anv_image_create(VkDevice _device, const VkAllocationCallbacks* alloc, VkImage *pImage); -const struct anv_surface * -anv_image_get_surface_for_aspect_mask(const struct anv_image *image, - VkImageAspectFlags aspect_mask); - enum isl_format anv_isl_format_for_descriptor_type(VkDescriptorType type);