mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
radv: Add ycbcr format features.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
This commit is contained in:
parent
b769a549ee
commit
52c1adda21
1 changed files with 27 additions and 0 deletions
|
|
@ -650,6 +650,25 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (desc->layout == VK_FORMAT_LAYOUT_MULTIPLANE ||
|
||||||
|
desc->layout == VK_FORMAT_LAYOUT_SUBSAMPLED) {
|
||||||
|
uint32_t tiling = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
|
||||||
|
VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
|
||||||
|
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
|
||||||
|
VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT;
|
||||||
|
|
||||||
|
/* The subsampled formats have no support for linear filters. */
|
||||||
|
if (desc->layout != VK_FORMAT_LAYOUT_SUBSAMPLED) {
|
||||||
|
tiling |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fails for unknown reasons with linear tiling & subsampled formats. */
|
||||||
|
out_properties->linearTilingFeatures = desc->layout == VK_FORMAT_LAYOUT_SUBSAMPLED ? 0 : tiling;
|
||||||
|
out_properties->optimalTilingFeatures = tiling;
|
||||||
|
out_properties->bufferFeatures = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (radv_is_storage_image_format_supported(physical_device, format)) {
|
if (radv_is_storage_image_format_supported(physical_device, format)) {
|
||||||
tiled |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
|
tiled |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
|
||||||
linear |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
|
linear |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
|
||||||
|
|
@ -1289,6 +1308,7 @@ VkResult radv_GetPhysicalDeviceImageFormatProperties2(
|
||||||
RADV_FROM_HANDLE(radv_physical_device, physical_device, physicalDevice);
|
RADV_FROM_HANDLE(radv_physical_device, physical_device, physicalDevice);
|
||||||
const VkPhysicalDeviceExternalImageFormatInfo *external_info = NULL;
|
const VkPhysicalDeviceExternalImageFormatInfo *external_info = NULL;
|
||||||
VkExternalImageFormatProperties *external_props = NULL;
|
VkExternalImageFormatProperties *external_props = NULL;
|
||||||
|
VkSamplerYcbcrConversionImageFormatProperties *ycbcr_props = NULL;
|
||||||
VkResult result;
|
VkResult result;
|
||||||
|
|
||||||
result = radv_get_image_format_properties(physical_device, base_info,
|
result = radv_get_image_format_properties(physical_device, base_info,
|
||||||
|
|
@ -1313,6 +1333,9 @@ VkResult radv_GetPhysicalDeviceImageFormatProperties2(
|
||||||
case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES:
|
case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES:
|
||||||
external_props = (void *) s;
|
external_props = (void *) s;
|
||||||
break;
|
break;
|
||||||
|
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES:
|
||||||
|
ycbcr_props = (void *) s;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1347,6 +1370,10 @@ VkResult radv_GetPhysicalDeviceImageFormatProperties2(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ycbcr_props) {
|
||||||
|
ycbcr_props->combinedImageSamplerDescriptorCount = vk_format_get_plane_count(base_info->format);
|
||||||
|
}
|
||||||
|
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue