venus: workaround an ANGLE assumption on FORMAT_IMPLEMENTATION_DEFINED

ANGLE expects VK_FORMAT_UNDEFINED to be returned for such AHB prop
query.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15721>
This commit is contained in:
Yiwei Zhang 2022-04-02 06:10:14 +00:00 committed by Marge Bot
parent 4208895175
commit 801cdd83f1

View file

@ -885,6 +885,13 @@ vn_android_get_ahb_format_properties(
vn_android_drm_format_is_yuv(buf_props.drm_fourcc)
? VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601
: VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY;
/* ANGLE expects VK_FORMAT_UNDEFINED with externalFormat resolved from
* AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED.
*/
if (desc.format == AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED)
format = VK_FORMAT_UNDEFINED;
*out_props = (VkAndroidHardwareBufferFormatPropertiesANDROID) {
.sType = out_props->sType,
.pNext = out_props->pNext,