anv: Delete anv_image::format

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12023>
This commit is contained in:
Jason Ekstrand 2021-07-21 18:11:39 -05:00 committed by Marge Bot
parent 951635dfe7
commit fc5a6eedbc
2 changed files with 3 additions and 6 deletions

View File

@ -1313,7 +1313,6 @@ anv_image_create(VkDevice _device,
image->extent = anv_sanitize_image_extent(pCreateInfo->imageType,
pCreateInfo->extent);
image->vk_format = pCreateInfo->format;
image->format = anv_get_format(pCreateInfo->format);
image->aspects = vk_format_aspects(image->vk_format);
image->levels = pCreateInfo->mipLevels;
image->array_size = pCreateInfo->arrayLayers;
@ -1356,14 +1355,14 @@ anv_image_create(VkDevice _device,
return VK_SUCCESS;
}
image->n_planes = image->format->n_planes;
image->n_planes = anv_get_format_planes(image->vk_format);
/* The Vulkan 1.2.165 glossary says:
*
* A disjoint image consists of multiple disjoint planes, and is created
* with the VK_IMAGE_CREATE_DISJOINT_BIT bit set.
*/
image->disjoint = image->format->n_planes > 1 &&
image->disjoint = image->n_planes > 1 &&
(pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT);
const isl_tiling_flags_t isl_tiling_flags =
@ -1594,9 +1593,8 @@ resolve_ahw_image(struct anv_device *device,
* isl_surface for it.
*/
image->vk_format = vk_format;
image->format = anv_get_format(vk_format);
image->aspects = vk_format_aspects(image->vk_format);
image->n_planes = image->format->n_planes;
image->n_planes = anv_get_format_planes(image->vk_format);
uint32_t stride = desc.stride *
(isl_format_get_layout(isl_fmt)->bpb / 8);

View File

@ -3954,7 +3954,6 @@ struct anv_image {
* of the actual surface formats.
*/
VkFormat vk_format;
const struct anv_format *format;
VkImageAspectFlags aspects;
VkExtent3D extent;