Apply fix for tessellation fractional even test verification.
authorJarkko Pöyry <jpoyry@google.com>
Fri, 27 Feb 2015 22:53:50 +0000 (14:53 -0800)
committerJarkko Pöyry <jpoyry@google.com>
Fri, 6 Mar 2015 19:32:53 +0000 (11:32 -0800)
- Fix to tessellation fractional even tessellation mode verification
  calculating additional segments' length wrong if tessellation generated
  4 segments, and the additional segments were generated as first and last
  segments.

Bug: 19543594
Change-Id: I1b1f682d99100db87d1cd3348547c47263e483a5

modules/gles31/functional/es31fTessellationTests.cpp

index 3b3a413..f2dec5d 100644 (file)
@@ -1325,6 +1325,12 @@ static bool verifyFractionalSpacingSingle (TestLog& log, SpacingMode spacingMode
                                        return false;
                                }
                        }
+                       else
+                       {
+                               // We have 2 segmentsA and 2 segmentsB, ensure segmentsB has the shorter lengths
+                               if (segmentsB[0].length > segmentsA[0].length)
+                                       std::swap(segmentsA, segmentsB);
+                       }
 
                        // Check that the additional segments are placed symmetrically.
                        if (segmentsB[0].index + segmentsB[1].index + 1 != (int)segments.size())
@@ -1341,8 +1347,8 @@ static bool verifyFractionalSpacingSingle (TestLog& log, SpacingMode spacingMode
                                additionalSegmentLocationDst = de::min(segmentsB[0].index, segmentsB[1].index);
                        else
                                additionalSegmentLocationDst = segmentsB[0].length < segmentsA[0].length - 0.001f ? de::min(segmentsB[0].index, segmentsB[1].index)
-                                                                                        : segmentsA[0].length < segmentsB[0].length - 0.001f ? de::min(segmentsA[0].index, segmentsA[1].index)
                                                                                         : -1; // \note -1 when can't reliably decide which ones are the additional segments, a or b.
+
                        return true;
                }
        }