Treat AHB YUV as external format

... as it does not have an equivalent format in the AHardwareBuffer Format Equivalence table in the Vulkan spec. (Note: AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 format handling needs to be updated as we currently assume a 3 plane layout) Bug: b/175132241 Test: launch Cuttlefish w/ SwANGLE and open Camera Change-Id: I2ac6a9937b2fd75f559d654f1e179ea5bcfa456f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/51051 Presubmit-Ready: Jason Macnak <natsu@google.com> Tested-by: 's avatarJason Macnak <natsu@google.com> Commit-Queue: Jason Macnak <natsu@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 714843a5
...@@ -398,6 +398,13 @@ VkResult AHardwareBufferExternalMemory::GetAndroidHardwareBufferFormatProperties ...@@ -398,6 +398,13 @@ VkResult AHardwareBufferExternalMemory::GetAndroidHardwareBufferFormatProperties
pFormat->suggestedXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN; pFormat->suggestedXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
pFormat->suggestedYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN; pFormat->suggestedYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
// YUV formats are not listed in the AHardwareBuffer Format Equivalence table in the Vulkan spec.
// Clients must use VkExternalFormatANDROID.
if(pFormat->format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM)
{
pFormat->format = VK_FORMAT_UNDEFINED;
}
return VK_SUCCESS; return VK_SUCCESS;
} }
......
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