From: Alok Hota Date: Wed, 12 Sep 2018 01:01:36 +0000 (-0500) Subject: swr/rast: add flat shading X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ae436203d90b45fe82aa07f4e4c9d0c8be6a7b13;p=mesa.git swr/rast: add flat shading 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 5eae34ef4e2..4145ba8dcce 100644 --- a/src/gallium/drivers/swr/rasterizer/common/simdintrin.h +++ b/src/gallium/drivers/swr/rasterizer/common/simdintrin.h @@ -305,6 +305,19 @@ static SIMDINLINE simdscalar InterpolateComponentFlat(const float* pInterpBuffer return vA; } +////////////////////////////////////////////////////////////////////////// +/// @brief Interpolates a single component (flat shade). +/// @param pInterpBuffer - pointer to attribute barycentric coeffs +template +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