From 8f20632a0ba45c3bfada293842e55129949a2ae9 Mon Sep 17 00:00:00 2001 From: Gangzheng Tong Date: Fri, 16 May 2025 14:51:46 -0700 Subject: Enable Windows full debug testsuite in CI (#7085) * Unify Debug Layer Control Logic and Add Disable Option for Debug Builds This PR refactors and unifies the debug layer control logic in slang-test. A new `-disable-debug-layers` option is introduced, allowing debug builds to skip enabling the validation (debug) layer. This is currently needed to ensure stability in the debug test suite. Previously, different toggles such as ENABLE_VALIDATION_LAYER, ENABLE_DEBUG_LAYER, and debugLayerEnabled were used inconsistently across different components of slang-test. This PR standardizes the logic by using a single variable, debugLayerEnabled, to control the enabling/disabling of the debug layer internally. Notes: By default, the debug/validation layer is enabled in debug builds and is not supported in release builds of slang-test. Fixes: #7132 * Disable spirv-opt for the DebugFunctionDefinition issue * Run debug build only in GCP machines * Fix VUID-vkCmdPipelineBarrier-pBufferMemoryBarriers-02818 dstAcessMask can't include VK_ACCESS_TRANSFER_READ_BIT when stage mask has VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR * Set failed retry limit to 32 --------- Co-authored-by: slangbot Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- tools/gfx/render.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tools/gfx/render.cpp') diff --git a/tools/gfx/render.cpp b/tools/gfx/render.cpp index 1ae7e370c..516369c0e 100644 --- a/tools/gfx/render.cpp +++ b/tools/gfx/render.cpp @@ -26,7 +26,13 @@ Result SLANG_MCALL getCUDAAdapters(List& outAdapters); Result SLANG_MCALL reportD3DLiveObjects(); +// Enable debug layer (validation layer) by default for DEBUG build +#if _DEBUG +static bool debugLayerEnabled = true; +#else static bool debugLayerEnabled = false; +#endif + bool isGfxDebugLayerEnabled() { return debugLayerEnabled; @@ -276,7 +282,7 @@ extern "C" return SLANG_E_NOT_IMPLEMENTED; #endif #if SLANG_WINDOWS_FAMILY || SLANG_LINUX_FAMILY - // Assume no Vulkan or CUDA on MacOS or Cygwin + // Assume no Vulkan or CUDA on MacOS or Cygwin case DeviceType::Vulkan: SLANG_RETURN_ON_FAIL(getVKAdapters(adapters)); break; @@ -428,9 +434,9 @@ extern "C" return SLANG_OK; } - SLANG_GFX_API void SLANG_MCALL gfxEnableDebugLayer() + SLANG_GFX_API void SLANG_MCALL gfxEnableDebugLayer(bool enable) { - debugLayerEnabled = true; + debugLayerEnabled = enable; } const char* SLANG_MCALL gfxGetDeviceTypeName(DeviceType type) -- cgit v1.2.3