Skip to content

Commit e1fb3f7

Browse files
authored
VK: Fix validation errors when creating a sampler (#9708)
When creating a sampler with a chroma conversion anisotropic must be disabled and the addressModes must be set to CLAMP_TO_EDGE. FIXES = [483454760]
1 parent e832805 commit e1fb3f7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

filament/backend/src/vulkan/VulkanExternalImageManager.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,13 @@ void VulkanExternalImageManager::bindExternallySampledTexture(
143143
// https://registry.khronos.org/vulkan/specs/latest/man/html/VkSamplerCreateInfo.html#VUID-VkSamplerCreateInfo-minFilter-01645
144144
samplerParams.filterMag = SamplerMagFilter::NEAREST;
145145
samplerParams.filterMin = SamplerMinFilter::NEAREST;
146+
// If the sampler has a ycbcrConversion then anisotropic must be disabled and addressModeU,
147+
// addressModeV and addressModeW must be VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.
148+
// https://docs.vulkan.org/spec/latest/chapters/samplers.html#VUID-VkSamplerCreateInfo-addressModeU-01646
149+
samplerParams.wrapS = SamplerWrapMode::CLAMP_TO_EDGE;
150+
samplerParams.wrapT = SamplerWrapMode::CLAMP_TO_EDGE;
151+
samplerParams.wrapR = SamplerWrapMode::CLAMP_TO_EDGE;
152+
samplerParams.anisotropyLog2 = 0;
146153

147154
VkSampler const sampler = mSamplerCache->getSampler({
148155
.sampler = samplerParams,

0 commit comments

Comments
 (0)