Commit 80308e20 by Tim Van Patten Committed by Commit Bot

Vulkan: Match min/magFilter to chromaFilter

VkSamplerCreateInfo.magFilter and minFilter must match VkSamplerYcbcrConversionCreateInfo.chromaFilter. VkSamplerYcbcrConversionCreateInfo.chromaFilter is currently hard-coded to VK_FILTER_NEAREST in HardwareBufferImageSiblingVkAndroid(), so force magFilter and minFilter to VK_FILTER_NEAREST in SamplerDesc::init() if an externalFormat is being used. Bug: b/178424566 Change-Id: Ia1f7fc21e3faa4e57f837ed3ae70608134150aea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2683038 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent bb062070
...@@ -3162,6 +3162,16 @@ angle::Result SamplerDesc::init(ContextVk *contextVk, Sampler *sampler) const ...@@ -3162,6 +3162,16 @@ angle::Result SamplerDesc::init(ContextVk *contextVk, Sampler *sampler) const
createInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; createInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
createInfo.anisotropyEnable = VK_FALSE; createInfo.anisotropyEnable = VK_FALSE;
createInfo.unnormalizedCoordinates = VK_FALSE; createInfo.unnormalizedCoordinates = VK_FALSE;
// VUID-VkSamplerCreateInfo-minFilter VkCreateSampler:
// VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT
// specifies that the format can have different chroma, min, and mag filters. However,
// VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT is
// not supported for VkSamplerYcbcrConversionCreateInfo.format = VK_FORMAT_UNDEFINED so
// minFilter/magFilter needs to be equal to chromaFilter.
// HardwareBufferImageSiblingVkAndroid() forces VK_FILTER_NEAREST, so force
// VK_FILTER_NEAREST here too.
createInfo.magFilter = VK_FILTER_NEAREST;
createInfo.minFilter = VK_FILTER_NEAREST;
} }
ANGLE_VK_TRY(contextVk, sampler->init(contextVk->getDevice(), createInfo)); ANGLE_VK_TRY(contextVk, sampler->init(contextVk->getDevice(), createInfo));
......
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