Mesa (master): swr/rast: Share vertex memory between VS input/output

Tim Rowley torowley at kemper.freedesktop.org
Fri Jun 16 21:30:05 UTC 2017


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

Author: Tim Rowley <timothy.o.rowley at intel.com>
Date:   Wed Jun  7 13:16:15 2017 -0500

swr/rast: Share vertex memory between VS input/output

Removes large simdvertex stack allocation.

Vertex shader must ensure reads happen before writes.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>

---

 src/gallium/drivers/swr/rasterizer/core/frontend.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
index 157a318009..902253b148 100644
--- a/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
+++ b/src/gallium/drivers/swr/rasterizer/core/frontend.cpp
@@ -1727,11 +1727,7 @@ void ProcessDraw(
     }
 
 #else
-    simdvertex          vin;
     SWR_VS_CONTEXT      vsContext;
-
-    vsContext.pVin = &vin;
-
     SWR_FETCH_CONTEXT   fetchInfo = { 0 };
 
     fetchInfo.pStreams = &state.vertexBuffers[0];
@@ -1787,6 +1783,7 @@ void ProcessDraw(
             }
 
             simdvertex& vout = pa.GetNextVsOutput();
+            vsContext.pVin = &vout;
             vsContext.pVout = &vout;
 
             if (i < endVertex)
@@ -1794,7 +1791,7 @@ void ProcessDraw(
 
                 // 1. Execute FS/VS for a single SIMD.
                 AR_BEGIN(FEFetchShader, pDC->drawId);
-                state.pfnFetchFunc(fetchInfo, vin);
+                state.pfnFetchFunc(fetchInfo, vout);
                 AR_END(FEFetchShader, 0);
 
                 // forward fetch generated vertex IDs to the vertex shader




More information about the mesa-commit mailing list