From ade53519001329938b8d2aef4aa0f563dddfd82d Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Thu, 16 Feb 2017 18:31:09 -0800 Subject: [PATCH] swr: [rasterizer common] Add InterpolateComponentFlat utility Reviewed-by: Bruce Cherniak --- .../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 8926e665173..ea79902a002 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdintrin.h +++ b/src/gallium/drivers/swr/rasterizer/common/simdintrin.h @@ -1122,6 +1122,19 @@ static INLINE simdscalar InterpolateComponent(simdscalar vI, simdscalar vJ, cons return vplaneps(vA, vB, vC, vI, vJ); } +////////////////////////////////////////////////////////////////////////// +/// @brief Interpolates a single component (flat shade). +/// @param pInterpBuffer - pointer to attribute barycentric coeffs +template +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 -- 2.30.2