DO NOT MERGE: 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)
committerDaniel Xie <dxie@google.com>
Tue, 27 Oct 2015 22:43:16 +0000 (22:43 +0000)
- 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: I69e9a03dfcd451fc4e995eae4b5149c67dc50399

modules/gles31/functional/es31fTessellationTests.cpp

index 5743788..3dfef3b 100644 (file)
@@ -1322,6 +1322,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())
@@ -1338,8 +1344,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;
                }
        }