From 1681bc67fbae57b54b66c5dcfcbf315d1efa831b Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Tue, 26 Aug 2025 14:38:57 -0700 Subject: Fail slang-test when VVL printed errors (#8280) fixes https://github.com/shader-slang/slang/issues/8271 This PR does the following, - Fail slang-test when there are VVL error messages. - VVL error for `gfx-unit-test-tool/` were not captured properly by the debug callback. - Set an environment variable, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, for CI and VisualStudio project setup. - Ignores VVL error about NullHandle is used for the acceleration structure; a fix is at ToT of VVL and not available from release build yet. - Fix VVL error complaining about the varying inputs are not provided for the tests, `gfx-unit-test-tool/linkTimeTypeLayout.internal` and `gfx-unit-test-tool/linkTimeTypeLayoutNested.internal`. --------- Co-authored-by: slangbot Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- tools/gfx/vulkan/vk-shader-object.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools/gfx/vulkan/vk-shader-object.cpp') diff --git a/tools/gfx/vulkan/vk-shader-object.cpp b/tools/gfx/vulkan/vk-shader-object.cpp index eaee69edb..58cb23f22 100644 --- a/tools/gfx/vulkan/vk-shader-object.cpp +++ b/tools/gfx/vulkan/vk-shader-object.cpp @@ -504,7 +504,6 @@ void ShaderObjectImpl::writeAccelerationStructureDescriptor( static_cast(resourceViews[i].Ptr()); VkWriteDescriptorSetAccelerationStructureKHR writeAS = {}; writeAS.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR; - VkAccelerationStructureKHR nullHandle = VK_NULL_HANDLE; if (accelerationStructure) { writeAS.accelerationStructureCount = 1; @@ -512,6 +511,12 @@ void ShaderObjectImpl::writeAccelerationStructureDescriptor( } else { + // The Vulkan spec states: If the nullDescriptor feature is not enabled, each element of + // pAccelerationStructures must not be VK_NULL_HANDLE + SLANG_ASSERT( + context.device->m_api.m_extendedFeatures.robustness2Features.nullDescriptor); + + static const VkAccelerationStructureKHR nullHandle = VK_NULL_HANDLE; writeAS.accelerationStructureCount = 1; writeAS.pAccelerationStructures = &nullHandle; } -- cgit v1.2.3