diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp index beacad1a8b..ce438046ac 100644 --- a/tools/render-test/options.cpp +++ b/tools/render-test/options.cpp @@ -249,6 +249,10 @@ static rhi::DeviceType _toRenderType(Slang::RenderApiType apiType) { SLANG_RETURN_ON_FAIL(reader.expectArg(outOptions.entryPointName)); } + else if (argValue == "-enable-backend-validation") + { + outOptions.enableBackendValidation = true; + } else { // Lookup diff --git a/tools/render-test/options.h b/tools/render-test/options.h index 2497ce7827..9a30030f72 100644 --- a/tools/render-test/options.h +++ b/tools/render-test/options.h @@ -87,6 +87,8 @@ struct Options bool generateSPIRVDirectly = true; + bool enableBackendValidation = false; + Options() { downstreamArgs.addName("slang"); } static SlangResult parse( diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index b1f9575512..812a753e3d 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -1367,10 +1367,12 @@ static SlangResult _innerMain( #if _DEBUG desc.enableValidation = true; - desc.enableBackendValidation = true; desc.debugCallback = &debugCallback; #endif + if (options.enableBackendValidation) + desc.enableBackendValidation = true; + desc.slang.lineDirectiveMode = SLANG_LINE_DIRECTIVE_MODE_NONE; if (options.generateSPIRVDirectly) desc.slang.targetFlags = SLANG_TARGET_FLAG_GENERATE_SPIRV_DIRECTLY; diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index a8127c3a82..37b1f43c9d 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -3478,6 +3478,15 @@ 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 (input.spawnType != SpawnType::UseTestServer) + cmdLine.addArg("-enable-backend-validation"); +#endif + if (context->isExecuting()) { // clear the stale actual output file first. This will allow us to detect error if