Skip to content

vulkan: Rename vk_image_view::format to view_format

Faith Ekstrand requested to merge gfxstrand/mesa:vulkan/image-view-format into main

When I originally added vk_image_view, I was overly clever when it came to the format field. I decided to make it only contain the bits of the format contained in the selected aspects. However, this is confusing (not generally a good thing) and it's also not always what you want. The Vulkan 1.3.204 spec says:

"When using an image view of a depth/stencil image to populate a
descriptor set (e.g. for sampling in the shader, or for use as an
input attachment), the aspectMask must only include one bit, which
selects whether the image view is used for depth reads (i.e. using a
floating-point sampler or input attachment in the shader) or stencil
reads (i.e. using an unsigned integer sampler or input attachment in
the shader). When an image view of a depth/stencil image is used as
a depth/stencil framebuffer attachment, the aspectMask is ignored
and both depth and stencil image subresources are used."

So, while the restricted format makes sense for texturing, it doesn't for when the image is being used as an attachment. What we probably actually want is both versions of the format. We'll call the one given by the VkImageViewCreateInfo vk_image_view::format and the restricted one vk_image_view::view_format.

Merge request reports