diff options
| author | Yong He <yonghe@outlook.com> | 2017-10-23 10:53:17 -0400 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-10-23 10:53:17 -0400 |
| commit | c8bda84077a73564e3ac05d8b886632b2b2561be (patch) | |
| tree | 9ff6039902ef3c9ab94f04398ba3541dc8c92b07 /tools/slang-test/main.cpp | |
| parent | 4d6be3588ac5b5b62e19900b12de90ce1e1ff744 (diff) | |
fix compute shader test result comparison
Diffstat (limited to 'tools/slang-test/main.cpp')
| -rw-r--r-- | tools/slang-test/main.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/slang-test/main.cpp b/tools/slang-test/main.cpp index 676cb6875..cdea6b4dc 100644 --- a/tools/slang-test/main.cpp +++ b/tools/slang-test/main.cpp @@ -1168,8 +1168,16 @@ TestResult doComputeComparisonTestRunImpl(TestInput& input, const char * langOpt { auto reference = referenceProgramOutput[i]; auto actual = actualProgramOutput[i]; - if (actual != reference) - return kTestResult_Fail; + if (actual != reference) + { + // try to parse reference as float, and compare again + auto val = StringToFloat(reference); + auto uval = String((unsigned int)FloatAsInt(val), 16).ToUpper(); + if (actual != uval) + return kTestResult_Fail; + else + return kTestResult_Pass; + } } return kTestResult_Pass; } |
