summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/swr
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2018-02-01 17:43:04 -0600
committerGeorge Kyriazis <[email protected]>2018-02-16 10:54:00 -0600
commit3e560b7c851d6b663bfdad4e10f1363404c80ad9 (patch)
tree9cb1e18d243ea76141f0dd57fe6a701c12c20cfb /src/gallium/drivers/swr
parentcb4b604ebdbaf6fb819864c12c2ae45b83c411df (diff)
swr/rast: Cull prims when all verts have negative clip distances
Performance optimization, and fixes some clipping issues. Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr')
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/clip.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/clip.h b/src/gallium/drivers/swr/rasterizer/core/clip.h
index 1d336b6aff6..519367228ea 100644
--- a/src/gallium/drivers/swr/rasterizer/core/clip.h
+++ b/src/gallium/drivers/swr/rasterizer/core/clip.h
@@ -417,6 +417,7 @@ public:
uint32_t slot = index >> 2;
uint32_t component = index & 0x3;
+ typename SIMD_T::Float vCullMaskElem = SIMD_T::set1_ps(-1.0f);
for (uint32_t e = 0; e < NumVertsPerPrim; ++e)
{
typename SIMD_T::Float vClipComp;
@@ -430,8 +431,11 @@ public:
}
typename SIMD_T::Float vClip = SIMD_T::template cmp_ps<SIMD_T::CompareType::UNORD_Q>(vClipComp, vClipComp);
+ typename SIMD_T::Float vCull = SIMD_T::template cmp_ps<SIMD_T::CompareType::NLE_UQ>(SIMD_T::setzero_ps(), vClipComp);
+ vCullMaskElem = SIMD_T::and_ps(vCullMaskElem, vCull);
vClipCullMask = SIMD_T::or_ps(vClipCullMask, vClip);
}
+ vClipCullMask = SIMD_T::or_ps(vClipCullMask, vCullMaskElem);
}
return SIMD_T::movemask_ps(vClipCullMask);