mirror of https://github.com/AxioDL/zeus.git
Add CColor::rgbDot()
This commit is contained in:
parent
39e240bf25
commit
5db81ca788
|
@ -290,6 +290,24 @@ public:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline float rgbDot(const CColor& rhs) const
|
||||||
|
{
|
||||||
|
#if __SSE__
|
||||||
|
TVectorUnion result;
|
||||||
|
#if __SSE4_1__ || __SSE4_2__
|
||||||
|
if (cpuFeatures().SSE41 || cpuFeatures().SSE42)
|
||||||
|
{
|
||||||
|
result.mVec128 = _mm_dp_ps(mVec128, rhs.mVec128, 0x71);
|
||||||
|
return result.v[0];
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
result.mVec128 = _mm_mul_ps(mVec128, rhs.mVec128);
|
||||||
|
return result.v[0] + result.v[1] + result.v[2];
|
||||||
|
#else
|
||||||
|
return (r * rhs.r) + (g * rhs.g) + (b * rhs.b);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
union {
|
union {
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue