From d34a3b49c3bb00d5bd700b1042a4e3817f8a07e3 Mon Sep 17 00:00:00 2001 From: smolnar Date: Sat, 12 Dec 2020 02:51:33 +0200 Subject: [PATCH] Backed out changeset ad64ffa1c7f6 (bug 1678938) for causing reftest failures. CLOSED TREE --- gfx/tests/crashtests/1678938-1.html | 9 --------- gfx/tests/crashtests/crashtests.list | 2 -- gfx/wr/swgl/src/gl.cc | 12 ++---------- 3 files changed, 2 insertions(+), 21 deletions(-) delete mode 100644 gfx/tests/crashtests/1678938-1.html diff --git a/gfx/tests/crashtests/1678938-1.html b/gfx/tests/crashtests/1678938-1.html deleted file mode 100644 index c2d535c6dc11..000000000000 --- a/gfx/tests/crashtests/1678938-1.html +++ /dev/null @@ -1,9 +0,0 @@ - -
-
- diff --git a/gfx/tests/crashtests/crashtests.list b/gfx/tests/crashtests/crashtests.list index 9ee62f64324e..be6bbe064b48 100644 --- a/gfx/tests/crashtests/crashtests.list +++ b/gfx/tests/crashtests/crashtests.list @@ -198,6 +198,4 @@ load 1650989-very-large-mask.html load 1650990.html skip-if(!webrender||AddressSanitizer) load 1652750-deep-scene-stack.html load 1651882.html -load 1678938-1.html load 1679477-1.html - diff --git a/gfx/wr/swgl/src/gl.cc b/gfx/wr/swgl/src/gl.cc index 21cbe5f0e528..f3dd9996f948 100644 --- a/gfx/wr/swgl/src/gl.cc +++ b/gfx/wr/swgl/src/gl.cc @@ -3748,13 +3748,7 @@ static int clip_side(int nump, Point3D* p, Interpolants* interp, Point3D* outP, assert(numClip < nump + 2); float prevDist = prevCoord - prevSide * prev.w; float curDist = curCoord - prevSide * cur.w; - // It may happen that after we interpolate by the weight k that due to - // floating point rounding we've underestimated the value necessary to - // push it over the clipping boundary. Just in case, nudge the mantissa - // by a single increment so that we essentially round it up and move it - // further inside the clipping boundary. We use nextafter to do this in - // a portable fashion. - float k = nextafterf(prevDist / (prevDist - curDist), 1.0f); + float k = prevDist / (prevDist - curDist); outP[numClip] = prev + (cur - prev) * k; outInterp[numClip] = prevInterp + (curInterp - prevInterp) * k; numClip++; @@ -3766,9 +3760,7 @@ static int clip_side(int nump, Point3D* p, Interpolants* interp, Point3D* outP, assert(numClip < nump + 2); float prevDist = prevCoord - curSide * prev.w; float curDist = curCoord - curSide * cur.w; - // Calculate interpolation weight k and the nudge it inside clipping - // boundary with nextafter. - float k = nextafterf(prevDist / (prevDist - curDist), 1.0f); + float k = prevDist / (prevDist - curDist); outP[numClip] = prev + (cur - prev) * k; outInterp[numClip] = prevInterp + (curInterp - prevInterp) * k; numClip++;