summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorAlok Hota <[email protected]>2018-09-11 20:01:36 -0500
committerAlok Hota <[email protected]>2019-04-30 19:48:12 +0000
commitae436203d90b45fe82aa07f4e4c9d0c8be6a7b13 (patch)
treef80b6faa22760e7f73c24fc3b34bbd2c7e186602 /src/gallium/drivers
parent9d01f4d63137a87a55604409137df57fd0ca48b1 (diff)
swr/rast: add flat shading
Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/swr/rasterizer/common/simdintrin.h13
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 5eae34ef4e2..4145ba8dcce 100644
--- a/src/gallium/drivers/swr/rasterizer/common/simdintrin.h
+++ b/src/gallium/drivers/swr/rasterizer/common/simdintrin.h
@@ -306,6 +306,19 @@ static SIMDINLINE simdscalar InterpolateComponentFlat(const float* pInterpBuffer
}
//////////////////////////////////////////////////////////////////////////
+/// @brief Interpolates a single component (flat shade).
+/// @param pInterpBuffer - pointer to attribute barycentric coeffs
+template <UINT Attrib, UINT Comp, UINT numComponents = 4>
+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
/// @param vJ - barycentric J