mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 11:40:10 +01:00
swr/rasterizer: Fix 3D resource copies.
Ensure constant attributes stay constant with barycentric interpolation. Reviewed-by: Alok Hota <alok.hota@intel.com>
This commit is contained in:
parent
ec4a5f5e13
commit
3d6cffffcf
1 changed files with 14 additions and 0 deletions
|
|
@ -282,6 +282,13 @@ static SIMDINLINE simdscalar InterpolateComponent(simdscalar const& vI,
|
||||||
const float* pInterpB = &pInterpBuffer[Attrib * 3 * numComponents + numComponents + Comp];
|
const float* pInterpB = &pInterpBuffer[Attrib * 3 * numComponents + numComponents + Comp];
|
||||||
const float* pInterpC = &pInterpBuffer[Attrib * 3 * numComponents + numComponents * 2 + Comp];
|
const float* pInterpC = &pInterpBuffer[Attrib * 3 * numComponents + numComponents * 2 + Comp];
|
||||||
|
|
||||||
|
if ((pInterpA[0] == pInterpB[0]) && (pInterpA[0] == pInterpC[0]))
|
||||||
|
{
|
||||||
|
// Ensure constant attribs are constant. Required for proper
|
||||||
|
// 3D resource copies.
|
||||||
|
return _simd_broadcast_ss(pInterpA);
|
||||||
|
}
|
||||||
|
|
||||||
simdscalar vA = _simd_broadcast_ss(pInterpA);
|
simdscalar vA = _simd_broadcast_ss(pInterpA);
|
||||||
simdscalar vB = _simd_broadcast_ss(pInterpB);
|
simdscalar vB = _simd_broadcast_ss(pInterpB);
|
||||||
simdscalar vC = _simd_broadcast_ss(pInterpC);
|
simdscalar vC = _simd_broadcast_ss(pInterpC);
|
||||||
|
|
@ -332,6 +339,13 @@ static SIMDINLINE simd4scalar InterpolateComponent(simd4scalar const& vI,
|
||||||
const float* pInterpB = &pInterpBuffer[Attrib * 3 * numComponents + numComponents + Comp];
|
const float* pInterpB = &pInterpBuffer[Attrib * 3 * numComponents + numComponents + Comp];
|
||||||
const float* pInterpC = &pInterpBuffer[Attrib * 3 * numComponents + numComponents * 2 + Comp];
|
const float* pInterpC = &pInterpBuffer[Attrib * 3 * numComponents + numComponents * 2 + Comp];
|
||||||
|
|
||||||
|
if ((pInterpA[0] == pInterpB[0]) && (pInterpA[0] == pInterpC[0]))
|
||||||
|
{
|
||||||
|
// Ensure constant attribs are constant. Required for proper
|
||||||
|
// 3D resource copies.
|
||||||
|
return SIMD128::broadcast_ss(pInterpA);
|
||||||
|
}
|
||||||
|
|
||||||
simd4scalar vA = SIMD128::broadcast_ss(pInterpA);
|
simd4scalar vA = SIMD128::broadcast_ss(pInterpA);
|
||||||
simd4scalar vB = SIMD128::broadcast_ss(pInterpB);
|
simd4scalar vB = SIMD128::broadcast_ss(pInterpB);
|
||||||
simd4scalar vC = SIMD128::broadcast_ss(pInterpC);
|
simd4scalar vC = SIMD128::broadcast_ss(pInterpC);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue