diff --git a/third_party/dawn/src/dawn/tests/white_box/SharedTextureMemoryYCbCrAndroidTests.cpp b/third_party/dawn/src/dawn/tests/white_box/SharedTextureMemoryYCbCrAndroidTests.cpp index 154d3b748b5..356317ddddb 100644 --- a/third_party/dawn/src/dawn/tests/white_box/SharedTextureMemoryYCbCrAndroidTests.cpp +++ b/third_party/dawn/src/dawn/tests/white_box/SharedTextureMemoryYCbCrAndroidTests.cpp @@ -393,6 +393,58 @@ TEST_P(SharedTextureMemoryYCbCrVulkanSamplersTests, ASSERT_DEVICE_ERROR(memory.BeginAccess(texture, &beginDesc)); } +// POC: Dawn does not enforce VUID-VkSamplerCreateInfo-addressModeU-01646. +// Creating a sampler with a YCbCr conversion attached and addressModeU/V/W != +// CLAMP_TO_EDGE is undefined behaviour per the Vulkan spec. Dawn's frontend +// validation (dawn/native/Sampler.cpp ValidateSamplerDescriptor) does not reject +// this, and dawn/native/vulkan/SamplerVk.cpp::Initialize passes the address modes +// through unchanged. +// +// Run with --enable-backend-validation=full to observe the VVL error: +// VUID-VkSamplerCreateInfo-addressModeU-01646 +// "If sampler YCbCr conversion is enabled, addressModeU, addressModeV, and +// addressModeW must be VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE" +TEST_P(SharedTextureMemoryYCbCrVulkanSamplersTests, YCbCrSamplerWithRepeatViolatesVUID01646) { + // Allocate a real multi-planar AHardwareBuffer so the driver sees a genuine + // external YCbCr format (matches what Chrome's VideoImageReaderImageBacking + // produces for HW-decoded