<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Reviewed-by: Tim Rowley <<a href="mailto:timothy.o.rowley@intel.com" class="">timothy.o.rowley@intel.com</a>>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Dec 8, 2016, at 8:21 PM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Large points become pairs of triangles when rasterized, so we must feed<br class="">
it three clip distances, one for each vertex.<br class="">
<br class="">
The clip distance is not subject to sprite coord replacement, so there's<br class="">
no interpolation of it. We just take its value and put it in the "z"<br class="">
component of the barycentric-ready plane equation.<br class="">
<br class="">
(We could also just cull it at an earlier point in time, but that would<br class="">
require larger changes.)<br class="">
<br class="">
Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>><br class="">
---<br class="">
src/gallium/drivers/swr/rasterizer/core/binner.cpp | 12 +++++++++---<br class="">
1 file changed, 9 insertions(+), 3 deletions(-)<br class="">
<br class="">
diff --git a/src/gallium/drivers/swr/rasterizer/core/binner.cpp b/src/gallium/drivers/swr/rasterizer/core/binner.cpp<br class="">
index 1538020..d5f2e97 100644<br class="">
--- a/src/gallium/drivers/swr/rasterizer/core/binner.cpp<br class="">
+++ b/src/gallium/drivers/swr/rasterizer/core/binner.cpp<br class="">
@@ -1185,9 +1185,15 @@ void BinPoints(<br class="">
            if (rastState.clipDistanceMask)<br class="">
            {<br class="">
                uint32_t numClipDist = _mm_popcnt_u32(rastState.clipDistanceMask);<br class="">
-                float one[2] = {1.0f, 1.0f};<br class="">
-                desc.pUserClipBuffer = (float*)pArena->Alloc(numClipDist * 2 * sizeof(float));<br class="">
-                ProcessUserClipDist<2>(pa, primIndex, rastState.clipDistanceMask, one, desc.pUserClipBuffer);<br class="">
+                desc.pUserClipBuffer = (float*)pArena->Alloc(numClipDist * 3 * sizeof(float));<br class="">
+                float dists[8];<br class="">
+                float one = 1.0f;<br class="">
+                ProcessUserClipDist<1>(pa, primIndex, rastState.clipDistanceMask, &one, dists);<br class="">
+                for (uint32_t i = 0; i < numClipDist; i++) {<br class="">
+                    desc.pUserClipBuffer[3*i + 0] = 0.0f;<br class="">
+                    desc.pUserClipBuffer[3*i + 1] = 0.0f;<br class="">
+                    desc.pUserClipBuffer[3*i + 2] = dists[i];<br class="">
+                }<br class="">
            }<br class="">
<br class="">
            MacroTileMgr *pTileMgr = pDC->pTileMgr;<br class="">
-- <br class="">
2.7.3<br class="">
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>