KhronosGroup / KhronosGroup/Vulkan-Docs
Does a Gather operation require the image format to support VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT?
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 549
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 2
Description
From https://docs.vulkan.org/spec/latest/chapters/formats.html#VkFormatFeatureFlagBits :
> [VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT](https://docs.vulkan.org/spec/latest/chapters/formats.html#VkFormatFeatureFlagBits) specifies that if [VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT](https://docs.vulkan.org/spec/latest/chapters/formats.html#VkFormatFeatureFlagBits) is also set, an image view can be used with a sampler that has either of magFilter or minFilter set to [VK_FILTER_LINEAR](https://docs.vulkan.org/spec/latest/chapters/samplers.html#VkFilter), or mipmapMode set to [VK_SAMPLER_MIPMAP_MODE_LINEAR](https://docs.vulkan.org/spec/latest/chapters/samplers.html#VkSamplerMipmapMode).
From https://docs.vulkan.org/spec/latest/chapters/textures.html#textures-gather :
> SPIR-V instructions with Gather in the name return a vector derived from 4 texels in the base level of the image view. The rules for the [VK_FILTER_LINEAR](https://docs.vulkan.org/spec/latest/chapters/samplers.html#VkFilter) minification filter are applied to identify the four selected texels.
It's unclear if "The rules for the VK_LINEAR_FILTER minification filter are applied" means that the texture format must have `VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT` in order to be used with a Gather operation.
For comparison, D3D12 explicitly calls out gather4 in its [Texture Formats](https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/hardware-support-for-direct3d-12-1-formats) list, and no integer format supports gather4, which implies to me it's a hardware limitation.
Contributor guide
Assessment
This issue has not been assessed yet.