summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/render-test/options.cpp4
-rw-r--r--tools/render-test/options.h2
-rw-r--r--tools/render-test/render-test-main.cpp4
-rw-r--r--tools/slang-test/slang-test-main.cpp9
4 files changed, 18 insertions, 1 deletions
diff --git a/tools/render-test/options.cpp b/tools/render-test/options.cpp
index beacad1a8..ce438046a 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 2497ce782..9a30030f7 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 b1f957551..812a753e3 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 a8127c3a8..37b1f43c9 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