From d80f4139bc4baa119a5dfcf74cdcf3a75b977efc Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Mon, 2 Jun 2025 16:47:16 -0700 Subject: Add a new slang-test option `-enable-debug-layers` (#7300) * Add a new slang-test option `-enable-debug-layers` A variable `disableDebugLayer` is renamed to `enableDebugLayers`, and a corresponding command-line argument is added, `-enable-debug-layers`. The previous option `-disable-debug-layer` is still available, but it prints a deprecation warning message. The reason why it is added is to make the option available to both Debug and Release. On Debug build, it will be enabled by default, and it will be disabled on Release build. We should be able to not only disable it, but also enable it on Release build. Ideally this option should be enabled all the time, but currently there are too many VUID error messages printed and we are enabling only for Debug build for now. Note that the CI/CD will run with the option disabled until we resolve all of VUID errors. --- tools/slang-test/slang-test-main.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'tools/slang-test/slang-test-main.cpp') diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 72af73cc1..f0a140549 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -3394,6 +3394,11 @@ static void _addRenderTestOptions(const Options& options, CommandLine& ioCmdLine ioCmdLine.addArg("-capability"); ioCmdLine.addArg(capability); } + + if (options.enableDebugLayers) + { + ioCmdLine.addArg("-enable-debug-layers"); + } } static SlangResult _extractProfileTime(const UnownedStringSlice& text, double& timeOut) @@ -3602,17 +3607,6 @@ TestResult runComputeComparisonImpl( auto actualOutputFile = outputStem + ".actual.txt"; cmdLine.addArg(actualOutputFile); -#if _DEBUG - // When using test server, any validation warning printed from the backend - // gets misinterpreted as the result from the test. - // This is due to the limitation that Slang RPC implementation expects only - // one time communication. - if (context->options.debugLayerEnabled && input.spawnType != SpawnType::UseTestServer) - { - cmdLine.addArg("-enable-debug-layers"); - } -#endif - if (context->isExecuting()) { // clear the stale actual output file first. This will allow us to detect error if @@ -4705,7 +4699,7 @@ static SlangResult runUnitTestModule( unitTestContext.slangGlobalSession = context->getSession(); unitTestContext.workDirectory = ""; unitTestContext.enabledApis = context->options.enabledApis; - unitTestContext.enableDebugLayers = context->options.debugLayerEnabled; + unitTestContext.enableDebugLayers = context->options.enableDebugLayers; unitTestContext.executableDirectory = context->exeDirectoryPath.getBuffer(); auto testCount = testModule->getTestCount(); @@ -4749,6 +4743,7 @@ static SlangResult runUnitTestModule( { TestServerProtocol::ExecuteUnitTestArgs args; args.enabledApis = context->options.enabledApis; + args.enableDebugLayers = context->options.enableDebugLayers; args.moduleName = moduleName; args.testName = test.testName; -- cgit v1.2.3