diff options
author | Jonathan Marek <[email protected]> | 2020-04-10 09:19:36 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-20 13:22:12 +0000 |
commit | d070a7ba0cfb11f1e01774b9dd3775ab7cd0c4ea (patch) | |
tree | 5ad01540e1ee1da55cbaf189e9f38014e5080be5 /src/freedreno/vulkan/tu_formats.c | |
parent | 70502f071cde4497104cf2b0d46a7e9fda5cef3a (diff) |
turnip: implement VK_KHR_sampler_ycbcr_conversion
Most changes based on radv, some simplification, since we don't need to
sample multiple planes, 422_UNORM/420_UNORM formats will be supported
directly using the hardware formats for those.
Signed-off-by: Jonathan Marek <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4590>
Diffstat (limited to 'src/freedreno/vulkan/tu_formats.c')
-rw-r--r-- | src/freedreno/vulkan/tu_formats.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/freedreno/vulkan/tu_formats.c b/src/freedreno/vulkan/tu_formats.c index 3dadbe1315b..bf76e93b36b 100644 --- a/src/freedreno/vulkan/tu_formats.c +++ b/src/freedreno/vulkan/tu_formats.c @@ -384,9 +384,15 @@ tu_physical_device_get_format_properties( VK_FORMAT_FEATURE_TRANSFER_DST_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT | - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT; + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT | + VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT | + VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT; + buffer |= VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT; + if (desc->layout != UTIL_FORMAT_LAYOUT_SUBSAMPLED) + optimal |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT; + if (physical_device->supported_extensions.EXT_filter_cubic) optimal |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT; } @@ -701,6 +707,7 @@ tu_GetPhysicalDeviceImageFormatProperties2( VkExternalImageFormatProperties *external_props = NULL; VkFilterCubicImageViewImageFormatPropertiesEXT *cubic_props = NULL; VkFormatFeatureFlags format_feature_flags; + VkSamplerYcbcrConversionImageFormatProperties *ycbcr_props = NULL; VkResult result; result = tu_get_image_format_properties(physical_device, @@ -733,6 +740,9 @@ tu_GetPhysicalDeviceImageFormatProperties2( case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: cubic_props = (void *) s; break; + case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: + ycbcr_props = (void *) s; + break; default: break; } @@ -767,6 +777,9 @@ tu_GetPhysicalDeviceImageFormatProperties2( } } + if (ycbcr_props) + ycbcr_props->combinedImageSamplerDescriptorCount = 1; + return VK_SUCCESS; fail: |