diff options
Diffstat (limited to 'tools/slang-test/main.cpp')
| -rw-r--r-- | tools/slang-test/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/slang-test/main.cpp b/tools/slang-test/main.cpp index 83d512cc1..5c0c81392 100644 --- a/tools/slang-test/main.cpp +++ b/tools/slang-test/main.cpp @@ -1205,9 +1205,10 @@ TestResult doImageComparison(String const& filePath) continue; } + float relativeDiff = 0.0f; if( expectedVal != 0 ) { - float relativeDiff = fabsf(float(actualVal) - float(expectedVal)) / float(expectedVal); + relativeDiff = fabsf(float(actualVal) - float(expectedVal)) / float(expectedVal); if( relativeDiff < kRelativeDiffCutoff ) { @@ -1220,6 +1221,13 @@ TestResult doImageComparison(String const& filePath) // cases where vertex shader results lead to rendering that is off // by one pixel... + fprintf(stderr, "image compare failure at (%d,%d) channel %d. expected %d got %d (absolute error: %d, relative error: %f)\n", + x, y, n, + expectedVal, + actualVal, + absoluteDiff, + relativeDiff); + // There was a difference we couldn't excuse! return kTestResult_Fail; } |
