From: Tim Rowley Date: Fri, 17 Feb 2017 02:31:09 +0000 (-0800) Subject: swr: [rasterizer common] Add InterpolateComponentFlat utility X-Git-Tag: upstream/17.1.0~1202 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ade53519001329938b8d2aef4aa0f563dddfd82d;p=platform%2Fupstream%2Fmesa.git swr: [rasterizer common] Add InterpolateComponentFlat utility Reviewed-by: Bruce Cherniak --- 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 +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