Skip to content

Commit

Permalink
Vulkan: populate ycbcr conversionDesc for yuv VkFormats
Browse files Browse the repository at this point in the history
For this case, the external format has a vulkan equivalent VkFormat and
is YUV, so conversionDesc needs to be populated.

YcbcrConversionDesc::update() expects externalFormat to be 0 in this
case since it has an equivalent.

Bug: b/368429977
Bug: b/352595520
Change-Id: Ifdae7a539555d78bbbf9d11cdbb946cb815c7709
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5896250
Reviewed-by: Charlie Lao <[email protected]>
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
  • Loading branch information
juston-li authored and Angle LUCI CQ committed Sep 30, 2024
1 parent 03b5ea3 commit e06b07a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,10 @@ angle::Result HardwareBufferImageSiblingVkAndroid::initImpl(DisplayVk *displayVk
// If not renderable, don't burn a slot on it.
vkFormat = &renderer->getFormat(angle::FormatID::NONE);
}
}

if (isExternal || imageFormat.isYUV)
{
// Note from Vulkan spec: Since GL_OES_EGL_image_external does not require the same sampling
// and conversion calculations as Vulkan does, achieving identical results between APIs may
// not be possible on some implementations.
Expand All @@ -411,12 +414,12 @@ angle::Result HardwareBufferImageSiblingVkAndroid::initImpl(DisplayVk *displayVk
: vk::YcbcrLinearFilterSupport::Unsupported;

conversionDesc.update(
renderer, bufferFormatProperties.externalFormat,
renderer, isExternal ? bufferFormatProperties.externalFormat : 0,
bufferFormatProperties.suggestedYcbcrModel, bufferFormatProperties.suggestedYcbcrRange,
bufferFormatProperties.suggestedXChromaOffset,
bufferFormatProperties.suggestedYChromaOffset, vk::kDefaultYCbCrChromaFilter,
bufferFormatProperties.samplerYcbcrConversionComponents, angle::FormatID::NONE,
linearFilterSupported);
bufferFormatProperties.samplerYcbcrConversionComponents,
isExternal ? angle::FormatID::NONE : imageFormat.id, linearFilterSupported);
}

const gl::TextureType textureType = AhbDescUsageToTextureType(ahbDescription, layerCount);
Expand Down

0 comments on commit e06b07a

Please sign in to comment.