Static code analysis fix for bounding box test
authorJari Komppa <jari.komppa@siru.fi>
Tue, 18 May 2021 12:25:07 +0000 (15:25 +0300)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 3 Jun 2021 08:58:59 +0000 (08:58 +0000)
After closer analysis turns out the mistake in the code
was using xmin twice; changed to use xmin and xmax.

Affects:
dEQP-GLES31.functional.primitive_bounding_box.call_order.*

Change-Id: I307126c3558e4b8700d3ed808e24c7d85bcb50dc
Components: OpenGL

modules/gles31/functional/es31fPrimitiveBoundingBoxTests.cpp

index ad46d94..0508247 100644 (file)
@@ -4848,9 +4848,14 @@ bool ViewportCallOrderCase::verifyImage (const tcu::PixelBufferAccess& result)
        for (int y = 0; y < result.getHeight(); ++y)
        for (int x = 0; x < result.getWidth(); ++x)
        {
+               /*
+                       Test stores the xmin,xmax values in the insideBorder and outsideBorder vectors.
+                       Thus the "y" in the vector is xmax.
+               */
+
                const tcu::IVec4        pixel                   = result.getPixelInt(x, y);
-               const bool                      insideMeshArea = x >= insideBorder.x() && x <= insideBorder.x();
-               const bool                      outsideMeshArea = x <= outsideBorder.x() && x >= outsideBorder.x();
+               const bool                      insideMeshArea  = x >= insideBorder.x() && x <= insideBorder.y();
+               const bool                      outsideMeshArea = x <= outsideBorder.x() && x >= outsideBorder.y();
 
                // inside mesh, allow green, yellow and any shade between
                // outside mesh, allow background (black) only