Skip to content

Commit 0c8cdec

Browse files
authored
Revise comparison function in no-over-optimization tests. (#3742)
Apply the suggested fix to conformance/uniforms/no-over-optimization-on-uniform-array-* tests to use a scale factor in the comparison function instead of a fixed constant. Fixes #3738.
1 parent 1beafa6 commit 0c8cdec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/tests/js/tests/no-over-optimizations-on-uniform-array.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ function testUniformOptimizationIssues(test) {
206206
gl.uniform4fv(locations[ii], [ii + 4, ii + 2, ii + 3, ii + 1]);
207207
}
208208

209-
var kEpsilon = 0.01;
209+
var kEpsilon = Math.pow(2, -10);
210210
var isSame = function(v1, v2) {
211-
return Math.abs(v1 - v2) < kEpsilon;
211+
return Math.abs(v1 - v2) < Math.abs(v1) * kEpsilon;
212212
};
213213

214214
for (var ii = 0; ii < test.maxUniformVectors; ++ii) {

0 commit comments

Comments
 (0)