diff options
author | Ilia Mirkin <[email protected]> | 2016-11-24 13:27:48 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2016-12-08 22:47:39 -0500 |
commit | 429e2ec324674ba8c3412b331da56d9a8808cd38 (patch) | |
tree | 68c264d4446071e758f6db16adfb6e442dc9a552 /src/gallium/drivers | |
parent | 192317dfeb8c9223b702196e0c8e8c555c24b844 (diff) |
swr: [rasterizer core] supply proper clip distances to point sprites
Large points become pairs of triangles when rasterized, so we must feed
it three clip distances, one for each vertex.
The clip distance is not subject to sprite coord replacement, so there's
no interpolation of it. We just take its value and put it in the "z"
component of the barycentric-ready plane equation.
(We could also just cull it at an earlier point in time, but that would
require larger changes.)
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/core/binner.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/binner.cpp b/src/gallium/drivers/swr/rasterizer/core/binner.cpp index 1538020a518..d5f2e97027d 100644 --- a/src/gallium/drivers/swr/rasterizer/core/binner.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/binner.cpp @@ -1185,9 +1185,15 @@ void BinPoints( if (rastState.clipDistanceMask) { uint32_t numClipDist = _mm_popcnt_u32(rastState.clipDistanceMask); - float one[2] = {1.0f, 1.0f}; - desc.pUserClipBuffer = (float*)pArena->Alloc(numClipDist * 2 * sizeof(float)); - ProcessUserClipDist<2>(pa, primIndex, rastState.clipDistanceMask, one, desc.pUserClipBuffer); + desc.pUserClipBuffer = (float*)pArena->Alloc(numClipDist * 3 * sizeof(float)); + float dists[8]; + float one = 1.0f; + ProcessUserClipDist<1>(pa, primIndex, rastState.clipDistanceMask, &one, dists); + for (uint32_t i = 0; i < numClipDist; i++) { + desc.pUserClipBuffer[3*i + 0] = 0.0f; + desc.pUserClipBuffer[3*i + 1] = 0.0f; + desc.pUserClipBuffer[3*i + 2] = dists[i]; + } } MacroTileMgr *pTileMgr = pDC->pTileMgr; |