summaryrefslogtreecommitdiff
path: root/tools/slang-test/slang-test-main.cpp
diff options
context:
space:
mode:
authorHarsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com>2025-04-04 12:27:08 +0530
committerGitHub <noreply@github.com>2025-04-04 06:57:08 +0000
commit4233d69cf88f1623cb573c8edb61456b24dc5339 (patch)
treedcb63bfd59b9e6b9f100242de0fb89ceadf874ee /tools/slang-test/slang-test-main.cpp
parentdf7c66be49822d650f8956662b16db49bae31d09 (diff)
fix(d3d11): correct parameter in VSSetConstantBuffers1 from uavCount … (#6690)
* fix(d3d11): correct parameter in VSSetConstantBuffers1 from uavCount to cbvCount (fixes #6531) Root cause - Incorrect parameter passing in slang-rhi 1. slang-rhi #281 - Add the correct cbvCount for setting Constant Buffer 2. Prevent render tests from overwriting reference images * Add missing tests/render/multiple-stage-io-locations.slang.3.expected.png * Add more expected images from texture2d-gather * Add new option: skipReferenceImageGeneration For Github CI we set this to true - So we don't overwrite the expected images --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
Diffstat (limited to 'tools/slang-test/slang-test-main.cpp')
-rw-r--r--tools/slang-test/slang-test-main.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 51dcf79ce..3f7e41cf6 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -3863,12 +3863,19 @@ TestResult runHLSLRenderComparisonTestImpl(
String expectedOutput;
String actualOutput;
- TestResult hlslResult =
- doRenderComparisonTestRun(context, input, expectedArg, ".expected", &expectedOutput);
- if (hlslResult != TestResult::Pass)
+ // Run the expected test case only if we're not skipping reference image generation
+ TestResult hlslResult = TestResult::Pass;
+ if (!context->options.skipReferenceImageGeneration)
{
- return hlslResult;
+ hlslResult =
+ doRenderComparisonTestRun(context, input, expectedArg, ".expected", &expectedOutput);
+ if (hlslResult != TestResult::Pass)
+ {
+ return hlslResult;
+ }
}
+
+ // Always run the actual test case
TestResult slangResult =
doRenderComparisonTestRun(context, input, actualArg, ".actual", &actualOutput);
if (slangResult != TestResult::Pass)
@@ -3881,7 +3888,12 @@ TestResult runHLSLRenderComparisonTestImpl(
return TestResult::Pass;
}
- Slang::File::writeAllText(outputStem + ".expected", expectedOutput);
+ // Save the expected output if we generated it
+ if (!context->options.skipReferenceImageGeneration)
+ {
+ Slang::File::writeAllText(outputStem + ".expected", expectedOutput);
+ }
+
Slang::File::writeAllText(outputStem + ".actual", actualOutput);
if (hlslResult == TestResult::Fail)
@@ -3889,9 +3901,10 @@ TestResult runHLSLRenderComparisonTestImpl(
if (slangResult == TestResult::Fail)
return TestResult::Fail;
- if (!StringUtil::areLinesEqual(
- actualOutput.getUnownedSlice(),
- expectedOutput.getUnownedSlice()))
+ // Compare text output only if we generated the expected output
+ if (!context->options.skipReferenceImageGeneration && !StringUtil::areLinesEqual(
+ actualOutput.getUnownedSlice(),
+ expectedOutput.getUnownedSlice()))
{
context->getTestReporter()->dumpOutputDifference(expectedOutput, actualOutput);