Commit e2f5da4b by Nicolas Capens Committed by Nicolas Capens

Claim support for YCbCr 3- and 2-plane 420 format

Implementation will follow. Bug: b/132437008 Tests: dEQP-VK.*ycbcr* Change-Id: I5fd4826257c6886e109d007ac926ee61895bf62d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31613 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 0c73680a
......@@ -93,7 +93,7 @@ const VkPhysicalDeviceFeatures& PhysicalDevice::getFeatures() const
void PhysicalDevice::getFeatures(VkPhysicalDeviceSamplerYcbcrConversionFeatures* features) const
{
features->samplerYcbcrConversion = VK_FALSE;
features->samplerYcbcrConversion = VK_TRUE;
}
void PhysicalDevice::getFeatures(VkPhysicalDevice16BitStorageFeatures* features) const
......@@ -326,7 +326,7 @@ void PhysicalDevice::getProperties(const VkExternalMemoryHandleTypeFlagBits* han
void PhysicalDevice::getProperties(VkSamplerYcbcrConversionImageFormatProperties* properties) const
{
properties->combinedImageSamplerDescriptorCount = 0;
properties->combinedImageSamplerDescriptorCount = 1; // Need only one descriptor for YCbCr sampling.
}
#ifdef __ANDROID__
......@@ -452,6 +452,16 @@ void PhysicalDevice::getFormatProperties(VkFormat format, VkFormatProperties* pF
VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
break;
// YCbCr formats:
case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
pFormatProperties->optimalTilingFeatures |=
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT;
break;
default:
break;
}
......
......@@ -399,10 +399,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
{
const VkPhysicalDeviceSamplerYcbcrConversionFeatures* samplerYcbcrConversionFeatures = reinterpret_cast<const VkPhysicalDeviceSamplerYcbcrConversionFeatures*>(extensionCreateInfo);
if(samplerYcbcrConversionFeatures->samplerYcbcrConversion == VK_TRUE)
{
return VK_ERROR_FEATURE_NOT_PRESENT;
}
// YCbCr conversion is supported.
// samplerYcbcrConversionFeatures->samplerYcbcrConversion can be VK_TRUE or VK_FALSE.
// No action needs to be taken on our end in either case; it's the apps responsibility that
// "To create a sampler YCbCr conversion, the samplerYcbcrConversion feature must be enabled."
(void)samplerYcbcrConversionFeatures->samplerYcbcrConversion;
}
break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment