[Mesa-dev] [PATCH 08/28] swr: [rasterizer common] Add InterpolateComponentFlat utility

Tim Rowley timothy.o.rowley at intel.com
Thu Mar 16 00:13:02 UTC 2017


---
 src/gallium/drivers/swr/rasterizer/common/simdintrin.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/gallium/drivers/swr/rasterizer/common/simdintrin.h b/src/gallium/drivers/swr/rasterizer/common/simdintrin.h
index 8926e66..ea79902 100644
--- a/src/gallium/drivers/swr/rasterizer/common/simdintrin.h
+++ b/src/gallium/drivers/swr/rasterizer/common/simdintrin.h
@@ -1123,6 +1123,19 @@ static INLINE simdscalar InterpolateComponent(simdscalar vI, simdscalar vJ, cons
 }
 
 //////////////////////////////////////////////////////////////////////////
+/// @brief Interpolates a single component (flat shade).
+/// @param pInterpBuffer - pointer to attribute barycentric coeffs
+template<UINT Attrib, UINT Comp, UINT numComponents = 4>
+static INLINE simdscalar InterpolateComponentFlat(const float *pInterpBuffer)
+{
+    const float *pInterpA = &pInterpBuffer[Attrib * 3 * numComponents + 0 + Comp];
+
+    simdscalar vA = _simd_broadcast_ss(pInterpA);
+
+    return vA;
+}
+
+//////////////////////////////////////////////////////////////////////////
 /// @brief Interpolates a single component.
 /// @param vI - barycentric I
 /// @param vJ - barycentric J
-- 
2.7.4



More information about the mesa-dev mailing list