venus: fix vn_GetAndroidHardwareBufferPropertiesANDROID

Append a VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT bit to pass cts.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10960>
This commit is contained in:
Yiwei Zhang 2021-05-23 00:11:18 +00:00 committed by Marge Bot
parent 8c06f018a4
commit 7f52544f6f
1 changed files with 8 additions and 1 deletions

View File

@ -803,12 +803,19 @@ vn_android_get_ahb_format_properties(
if (result != VK_SUCCESS)
return result;
/* The spec requires that formatFeatures must include at least one of
* VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT or
* VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT.
*/
const VkFormatFeatureFlags format_features =
mod_props.drmFormatModifierTilingFeatures |
VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT;
*out_props = (VkAndroidHardwareBufferFormatPropertiesANDROID) {
.sType = out_props->sType,
.pNext = out_props->pNext,
.format = format,
.externalFormat = desc.format,
.formatFeatures = mod_props.drmFormatModifierTilingFeatures,
.formatFeatures = format_features,
.samplerYcbcrConversionComponents = {
.r = VK_COMPONENT_SWIZZLE_IDENTITY,
.g = VK_COMPONENT_SWIZZLE_IDENTITY,