Skip to content

Commit c8bda84

Browse files
committed
fix compute shader test result comparison
1 parent 4d6be35 commit c8bda84

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
0.0
2-
1.0
3-
2.0
4-
3.0
1+
0
2+
3F800000
3+
40000000
4+
40400000

tools/slang-test/main.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -1168,8 +1168,16 @@ TestResult doComputeComparisonTestRunImpl(TestInput& input, const char * langOpt
11681168
{
11691169
auto reference = referenceProgramOutput[i];
11701170
auto actual = actualProgramOutput[i];
1171-
if (actual != reference)
1172-
return kTestResult_Fail;
1171+
if (actual != reference)
1172+
{
1173+
// try to parse reference as float, and compare again
1174+
auto val = StringToFloat(reference);
1175+
auto uval = String((unsigned int)FloatAsInt(val), 16).ToUpper();
1176+
if (actual != uval)
1177+
return kTestResult_Fail;
1178+
else
1179+
return kTestResult_Pass;
1180+
}
11731181
}
11741182
return kTestResult_Pass;
11751183
}

0 commit comments

Comments
 (0)