Mesa (master): swr/rast: add flat shading

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 30 19:56:01 UTC 2019


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

Author: Alok Hota <alok.hota at intel.com>
Date:   Tue Sep 11 20:01:36 2018 -0500

swr/rast: add flat shading

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

---

 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 5eae34ef4e2..4145ba8dcce 100644
--- a/src/gallium/drivers/swr/rasterizer/common/simdintrin.h
+++ b/src/gallium/drivers/swr/rasterizer/common/simdintrin.h
@@ -306,6 +306,19 @@ static SIMDINLINE simdscalar InterpolateComponentFlat(const float* pInterpBuffer
 }
 
 //////////////////////////////////////////////////////////////////////////
+/// @brief Interpolates a single component (flat shade).
+/// @param pInterpBuffer - pointer to attribute barycentric coeffs
+template <UINT Attrib, UINT Comp, UINT numComponents = 4>
+static SIMDINLINE simdscalari InterpolateComponentFlatInt(const uint32_t* pInterpBuffer)
+{
+    const uint32_t interpA = pInterpBuffer[Attrib * 3 * numComponents + 0 + Comp];
+
+    simdscalari vA = _simd_set1_epi32(interpA);
+
+    return vA;
+}
+
+//////////////////////////////////////////////////////////////////////////
 /// @brief Interpolates a single component.
 /// @param vI - barycentric I
 /// @param vJ - barycentric J




More information about the mesa-commit mailing list