Update AHB default YUV dataspace to YCBCR_601
Eventually, this should probably be fetched from the
gralloc buffer metadata using
Gralloc4::Get(android::gralloc4::MetadataType_Dataspace)
Bug: b/147316305
Bug: b/175132241
Test: launch Cuttlefish w/ SwANGLE
Test: cts -m CtsGraphicsTestCases -t
MediaVulkanGpuTest#testMediaImportAndRendering
Change-Id: Ie991380d2d27e7a540ffe37cfc81109618f2d507
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51688
Presubmit-Ready: Jason Macnak <natsu@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Jason Macnak <natsu@google.com>
Commit-Queue: Jason Macnak <natsu@google.com>
diff --git a/src/Vulkan/VkDeviceMemoryExternalAndroid.cpp b/src/Vulkan/VkDeviceMemoryExternalAndroid.cpp
index 729a9d0..452306c 100644
--- a/src/Vulkan/VkDeviceMemoryExternalAndroid.cpp
+++ b/src/Vulkan/VkDeviceMemoryExternalAndroid.cpp
@@ -407,7 +407,7 @@
pFormat->externalFormat = ahbDesc.format;
pFormat->formatFeatures = GetVkFormatFeaturesFromAHBFormat(ahbDesc.format);
pFormat->samplerYcbcrConversionComponents = { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY };
- pFormat->suggestedYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709;
+ pFormat->suggestedYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601;
pFormat->suggestedYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL;
pFormat->suggestedXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
pFormat->suggestedYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;