Mesa (master): gallium/tessellator: Remove XBOX 360 code

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Feb 21 22:43:40 UTC 2021


Module: Mesa
Branch: master
Commit: bca9e7fe234de2c155c64e08e8577047c1d263e9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bca9e7fe234de2c155c64e08e8577047c1d263e9

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Feb 17 19:53:50 2021 -0500

gallium/tessellator: Remove XBOX 360 code

Unused.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Acked-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9118>

---

 src/gallium/auxiliary/tessellator/tessellator.cpp | 67 +----------------------
 src/gallium/auxiliary/tessellator/tessellator.hpp | 14 -----
 2 files changed, 1 insertion(+), 80 deletions(-)

diff --git a/src/gallium/auxiliary/tessellator/tessellator.cpp b/src/gallium/auxiliary/tessellator/tessellator.cpp
index 91a5390278d..cc0629622de 100644
--- a/src/gallium/auxiliary/tessellator/tessellator.cpp
+++ b/src/gallium/auxiliary/tessellator/tessellator.cpp
@@ -440,9 +440,6 @@ CHWTessellator::CHWTessellator()
     m_NumIndices = 0;
     m_bUsingPatchedIndices = false;
     m_bUsingPatchedIndices2 = false;
-#ifdef ALLOW_XBOX_360_COMPARISON
-	m_bXBox360Mode = false;
-#endif
 }
 //---------------------------------------------------------------------------------------------------------------------------------
 // CHWTessellator::~CHWTessellator
@@ -1770,21 +1767,11 @@ void CHWTessellator::ComputeTessFactorContext( FXP fxpTessFactor, TESS_FACTOR_CO
         }
         else
         {
-#ifdef ALLOW_XBOX_360_COMPARISON
-            if( m_bXBox360Mode )
-                TessFactorCtx.splitPointOnFloorHalfTessFactor = TessFactorCtx.numHalfTessFactorPoints-2;
-            else
-#endif
 				TessFactorCtx.splitPointOnFloorHalfTessFactor = (RemoveMSB((fxpFloorHalfTessFactor>>FXP_FRACTION_BITS)-1)<<1) + 1;
         }
     }
     else
     {
-#ifdef ALLOW_XBOX_360_COMPARISON
-        if( m_bXBox360Mode )
-            TessFactorCtx.splitPointOnFloorHalfTessFactor = TessFactorCtx.numHalfTessFactorPoints-1;
-        else
-#endif
 			TessFactorCtx.splitPointOnFloorHalfTessFactor = (RemoveMSB(fxpFloorHalfTessFactor>>FXP_FRACTION_BITS)<<1) + 1;
     }
     int numFloorSegments = (fxpFloorHalfTessFactor * 2)>>FXP_FRACTION_BITS;
@@ -1952,58 +1939,6 @@ void CHWTessellator::StitchTransition(int baseIndexOffset,
                                     TESSELLATOR_PARITY outsideTessFactorParity
 )
 {
-
-#ifdef ALLOW_XBOX_360_COMPARISON
-    // Tables to assist in the stitching of 2 rows of points having arbitrary TessFactors.
-    // The stitching order is governed by Ruler Function vertex split ordering (see external documentation).
-    //
-    // The contents of the finalPointPositionTable are where vertex i [0..32] ends up on the half-edge
-    // at the max tessellation amount given ruler-function split order.
-    // Recall the other half of an edge is mirrored, so we only need to deal with one half.
-    // This table is used to decide when to advance a point on the interior or exterior.
-    // It supports odd TessFactor up to 65 and even TessFactor up to 64.
-    static const int _finalPointPositionTable[33] =
-            { 0, 32, 16, 8, 17, 4, 18, 9, 19, 2, 20, 10, 21, 5, 22, 11, 23,
-              1, 24, 12, 25, 6, 26, 13, 27, 3, 28, 14, 29, 7, 30, 15, 31 };
-    // The loopStart and loopEnd tables below just provide optimal loop bounds for the
-    // stitching algorithm further below, for any given halfTssFactor.
-    // There is probably a better way to encode this...
-
-    // loopStart[halfTessFactor] encodes the FIRST entry other that [0] in finalPointPositionTable[] above which is
-    // less than halfTessFactor.  Exceptions are entry 0 and 1, which are set up to skip the loop.
-    static const int _loopStart[33] =
-            {1,1,17,9,9,5,5,5,5,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
-    // loopStart[halfTessFactor] encodes the LAST entry in finalPointPositionTable[] above which is
-    // less than halfTessFactor.  Exceptions are entry 0 and 1, which are set up to skip the loop.
-    static const int _loopEnd[33] =
-            {0,0,17,17,25,25,25,25,29,29,29,29,29,29,29,29,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,32};
-    const int* finalPointPositionTable;
-    const int* loopStart;
-    const int* loopEnd;
-    if( m_bXBox360Mode )
-    {
-        // The XBox360 vertex introduction order is always from the center of the edge.
-        // So the final positions of points on the half-edge are this trivial table.
-        static const int XBOXfinalPointPositionTable[33] =
-                { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
-                  18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 };
-        // loopStart and loopEnd (meaning described above) also become trivial for XBox360 splitting.
-        static const int XBOXloopStart[33] =
-                {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
-        static const int XBOXloopEnd[33] =
-                {0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
-
-        finalPointPositionTable = XBOXfinalPointPositionTable;
-        loopStart = XBOXloopStart;
-        loopEnd = XBOXloopEnd;
-    }
-    else
-    {
-        finalPointPositionTable = _finalPointPositionTable;
-        loopStart = _loopStart;
-        loopEnd =_loopEnd;
-    }
-#else
     // Tables to assist in the stitching of 2 rows of points having arbitrary TessFactors.
     // The stitching order is governed by Ruler Function vertex split ordering (see external documentation).
     //
@@ -2028,7 +1963,7 @@ void CHWTessellator::StitchTransition(int baseIndexOffset,
     // less than halfTessFactor.  Exceptions are entry 0 and 1, which are set up to skip the loop.
     static const int loopEnd[33] =
             {0,0,17,17,25,25,25,25,29,29,29,29,29,29,29,29,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,31,32};
-#endif
+
     if( TESSELLATOR_PARITY_ODD == insideEdgeTessFactorParity )
     {
         insideNumHalfTessFactorPoints -= 1;
diff --git a/src/gallium/auxiliary/tessellator/tessellator.hpp b/src/gallium/auxiliary/tessellator/tessellator.hpp
index 459c1093d2e..d30b186e58c 100644
--- a/src/gallium/auxiliary/tessellator/tessellator.hpp
+++ b/src/gallium/auxiliary/tessellator/tessellator.hpp
@@ -145,17 +145,6 @@ public:
     int* GetIndices();         // Get CHWTessellator owned pointer to vertex indices.
                                // Pointer is fixed for lifetime of CHWTessellator object.
 
-#define ALLOW_XBOX_360_COMPARISON // Different vertex splitting order. This is NOT D3D11 behavior, just available here for comparison.
-	                              // Setting this define true just allows the XBox split style to be enabled via
-	                              // SetXBox360Mode() below, but by default this XBox360 mode still always starts off DISABLED.
-								  // The XBox360 always splits from the center of an edge (D3D11 uses ruler function).  Splitting
-	                              // from the center causes sliver triangles in transition areas, which cause numerous problems.
-                                  // Note the XBox360 only supports adaptive tessellation via fractional_even partitioning,
-                                  // though this #define lets you try the XBox vertex splitting order with any of the
-                                  // partitioning modes: even, odd, integer or pow2.
-#ifdef ALLOW_XBOX_360_COMPARISON
-    void SetXBox360Mode(bool bXboxMode) {m_bXBox360Mode = bXboxMode;}
-#endif
     CHWTessellator();
     ~CHWTessellator();
 //---------------------------------------------------------------------------------------------------------------------------------
@@ -193,9 +182,6 @@ private:
     int*                                 m_Index; // array where we will store index topology
     int                                  m_NumPoints;
     int                                  m_NumIndices;
-#ifdef ALLOW_XBOX_360_COMPARISON
-    bool                                 m_bXBox360Mode;
-#endif
     // PlacePointIn1D below is the workhorse for all position placement.
     // It is code that could run as preamble in a Domain Shader, so the tessellator itself
     // doesn't necessarily need to have floating point.



More information about the mesa-commit mailing list