Skip complex compare verification if reference and result are identical.
authorJarkko Pöyry <jpoyry@google.com>
Sat, 11 Apr 2015 00:00:22 +0000 (17:00 -0700)
committerJarkko Pöyry <jpoyry@google.com>
Fri, 17 Apr 2015 02:18:56 +0000 (19:18 -0700)
Change-Id: I75ac3430812fd8fe9fda78bc09f9ef1aece1e61e

modules/glshared/glsTextureTestUtil.cpp

index c87188f..9c59bec 100644 (file)
@@ -2823,6 +2823,9 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                                continue;
                        }
 
+                       // Reference result is known to be a valid result, we can
+                       // skip verification if thes results are equal
+                       if (resPix.x() != refPix.x())
                        {
                                const float             wx              = (float)px + 0.5f;
                                const float             wy              = (float)py + 0.5f;
@@ -2926,6 +2929,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                        const tcu::Vec4 resPix  = result.getPixel(px, py);
                        const tcu::Vec4 refPix  = reference.getPixel(px, py);
 
+                       // Other channels should trivially match to reference.
                        if (!tcu::boolAll(tcu::lessThanEqual(tcu::abs(refPix.swizzle(1,2,3) - resPix.swizzle(1,2,3)), nonShadowThreshold)))
                        {
                                errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
@@ -2933,6 +2937,9 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                                continue;
                        }
 
+                       // Reference result is known to be a valid result, we can
+                       // skip verification if thes results are equal
+                       if (resPix.x() != refPix.x())
                        {
                                const float             wx              = (float)px + 0.5f;
                                const float             wy              = (float)py + 0.5f;
@@ -3044,6 +3051,7 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                        const tcu::Vec4 resPix  = result.getPixel(px, py);
                        const tcu::Vec4 refPix  = reference.getPixel(px, py);
 
+                       // Other channels should trivially match to reference.
                        if (!tcu::boolAll(tcu::lessThanEqual(tcu::abs(refPix.swizzle(1,2,3) - resPix.swizzle(1,2,3)), nonShadowThreshold)))
                        {
                                errorMask.setPixel(tcu::RGBA::red.toVec(), px, py);
@@ -3051,6 +3059,9 @@ int computeTextureCompareDiff (const tcu::ConstPixelBufferAccess& result,
                                continue;
                        }
 
+                       // Reference result is known to be a valid result, we can
+                       // skip verification if thes results are equal
+                       if (resPix.x() != refPix.x())
                        {
                                const float             wx              = (float)px + 0.5f;
                                const float             wy              = (float)py + 0.5f;