-static VkFormat
-choose_iview_format(struct anv_image *image, VkImageAspectFlagBits aspect)
-{
- assert(__builtin_popcount(aspect) == 1);
-
- struct isl_surf *surf =
- &anv_image_get_surface_for_aspect_mask(image, aspect)->isl;
-
- /* vkCmdCopyImage behaves like memcpy. Therefore we choose identical UINT
- * formats for the source and destination image views.
- *
- * From the Vulkan spec (2015-12-30):
- *
- * vkCmdCopyImage performs image copies in a similar manner to a host
- * memcpy. It does not perform general-purpose conversions such as
- * scaling, resizing, blending, color-space conversion, or format
- * conversions. Rather, it simply copies raw image data. vkCmdCopyImage
- * can copy between images with different formats, provided the formats
- * are compatible as defined below.
- *
- * [The spec later defines compatibility as having the same number of
- * bytes per block].
- */
- return vk_format_for_size(isl_format_layouts[surf->format].bs);
-}
-
-static VkFormat
-choose_buffer_format(VkFormat format, VkImageAspectFlagBits aspect)
-{
- assert(__builtin_popcount(aspect) == 1);
-
- /* vkCmdCopy* commands behave like memcpy. Therefore we choose
- * compatable UINT formats for the source and destination image views.
- *
- * For the buffer, we go back to the original image format and get a
- * the format as if it were linear. This way, for RGB formats, we get
- * an RGB format here even if the tiled image is RGBA. XXX: This doesn't
- * work if the buffer is the destination.
- */
- enum isl_format linear_format = anv_get_isl_format(format, aspect,
- VK_IMAGE_TILING_LINEAR,
- NULL);
-
- return vk_format_for_size(isl_format_layouts[linear_format].bs);
-}
-