diff options
author | Tim Rowley <[email protected]> | 2017-02-16 18:31:09 -0800 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2017-03-20 18:04:53 -0500 |
commit | ade53519001329938b8d2aef4aa0f563dddfd82d (patch) | |
tree | 10ef77dcac7beb7dd0189a7110f2a832839893ad /src/gallium/drivers/swr/rasterizer/common | |
parent | ab04221bf1064fbd95702c4eb8f197c20962d692 (diff) |
swr: [rasterizer common] Add InterpolateComponentFlat utility
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/rasterizer/common')
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/common/simdintrin.h | 13 |
1 files changed, 13 insertions, 0 deletions
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 @@ -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 |