swr: [rasterizer common] Add InterpolateComponentFlat utility
Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
@@ -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<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
|
||||
|
||||
Reference in New Issue
Block a user