Skip to content

Commit b1ae635

Browse files
committed
Address review feedback
1 parent c9f97d5 commit b1ae635

2 files changed

Lines changed: 10 additions & 29 deletions

File tree

tools/render-test/slang-support.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,18 @@ class ScopedCoreDebugCallback
4242
{
4343
public:
4444
ScopedCoreDebugCallback(CoreToRHIDebugBridge& bridge, Slang::IDebugCallback* coreCallback)
45-
: m_bridge(&bridge)
45+
: m_bridge(bridge)
4646
{
47-
m_bridge->setCoreCallback(coreCallback);
47+
m_bridge.setCoreCallback(coreCallback);
4848
}
4949

50-
~ScopedCoreDebugCallback()
51-
{
52-
if (m_bridge)
53-
{
54-
m_bridge->setCoreCallback(nullptr);
55-
}
56-
}
50+
~ScopedCoreDebugCallback() { m_bridge.setCoreCallback(nullptr); }
5751

5852
ScopedCoreDebugCallback(const ScopedCoreDebugCallback&) = delete;
5953
ScopedCoreDebugCallback& operator=(const ScopedCoreDebugCallback&) = delete;
6054

6155
private:
62-
CoreToRHIDebugBridge* m_bridge;
56+
CoreToRHIDebugBridge& m_bridge;
6357
};
6458

6559
/// Core debug callback that captures debug messages in a string buffer

tools/slang-test/slang-test-main.cpp

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,11 +1876,6 @@ String getOutput(const ExecuteResult& exeRes, bool removeEmbeddedSource = false)
18761876
return actualOutputBuilder.produceString();
18771877
}
18781878

1879-
static bool _hasDebugLayerError(const ExecuteResult& exeRes)
1880-
{
1881-
return exeRes.debugLayer.getLength() > 0;
1882-
}
1883-
18841879
// Finds the specialized or default path for expected data for a test.
18851880
// If neither are found, will return an empty string
18861881
String findExpectedPath(const TestInput& input, const char* postFix)
@@ -2718,7 +2713,7 @@ TestResult runSimpleTest(TestContext* context, TestInput& input)
27182713
context,
27192714
input,
27202715
actualOutput,
2721-
_hasDebugLayerError(exeRes),
2716+
false,
27222717
"result code = 0\nstandard error = {\n}\nstandard output = {\n}\n",
27232718
[&input](auto e, auto a) { return _areResultsEqual(input.testOptions->type, e, a); });
27242719
}
@@ -2832,7 +2827,7 @@ TestResult runInterpreterTest(TestContext* context, TestInput& input)
28322827
context,
28332828
input,
28342829
actualOutput,
2835-
_hasDebugLayerError(exeRes),
2830+
false,
28362831
"result code = 0\nstandard error = {\n}\nstandard output = {\n}\n",
28372832
[&input](auto e, auto a) { return _areResultsEqual(input.testOptions->type, e, a); });
28382833
}
@@ -2867,7 +2862,7 @@ TestResult runDispatcherTest(TestContext* context, TestInput& input)
28672862
context,
28682863
input,
28692864
actualOutput,
2870-
_hasDebugLayerError(exeRes),
2865+
false,
28712866
"result code = 0\nstandard error = {\n}\nstandard output = {\n}\n",
28722867
[&input](auto e, auto a) { return _areResultsEqual(input.testOptions->type, e, a); });
28732868
}
@@ -3066,11 +3061,7 @@ TestResult runReflectionTest(TestContext* context, TestInput& input)
30663061
}
30673062
}
30683063

3069-
return _validateOutput(
3070-
context,
3071-
input,
3072-
actualOutput,
3073-
_hasDebugLayerError(exeRes));
3064+
return _validateOutput(context, input, actualOutput);
30743065
}
30753066

30763067
static String _calcSummary(IArtifactDiagnostics* inDiagnostics)
@@ -3728,11 +3719,7 @@ static TestResult _runHLSLComparisonTest(
37283719
// Always fail if the compilation produced a failure, just
37293720
// to catch situations where, e.g., command-line options parsing
37303721
// caused the same error in both the Slang and fxc cases.
3731-
return _validateOutput(
3732-
context,
3733-
input,
3734-
actualOutput,
3735-
resultCode != 0 || _hasDebugLayerError(exeRes));
3722+
return _validateOutput(context, input, actualOutput, resultCode != 0);
37363723
}
37373724

37383725
static TestResult runDXBCComparisonTest(TestContext* context, TestInput& input)
@@ -4125,7 +4112,7 @@ TestResult runComputeComparisonImpl(
41254112
context,
41264113
input,
41274114
actualOutput,
4128-
_hasDebugLayerError(exeRes),
4115+
false,
41294116
"result code = 0\nstandard error = {\n}\nstandard output = {\n}\n");
41304117

41314118
// check against reference output

0 commit comments

Comments
 (0)