mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 23:25:41 +00:00
GSVector: Remove unused functions
This commit is contained in:
parent
d8413719c1
commit
d70f5ddb32
|
@ -7,22 +7,6 @@
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
enum Align_Mode
|
|
||||||
{
|
|
||||||
Align_Outside,
|
|
||||||
Align_Inside,
|
|
||||||
Align_NegInf,
|
|
||||||
Align_PosInf
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Round_Mode
|
|
||||||
{
|
|
||||||
Round_NearestInt = 8,
|
|
||||||
Round_NegInf = 9,
|
|
||||||
Round_PosInf = 10,
|
|
||||||
Round_Truncate = 11
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class GSVector2T
|
class GSVector2T
|
||||||
{
|
{
|
||||||
|
|
|
@ -141,50 +141,6 @@ public:
|
||||||
ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); }
|
ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); }
|
||||||
ALWAYS_INLINE bool rcontains(const GSVector4i& v) const { return rintersect(v).eq(v); }
|
ALWAYS_INLINE bool rcontains(const GSVector4i& v) const { return rintersect(v).eq(v); }
|
||||||
|
|
||||||
template<Align_Mode mode>
|
|
||||||
GSVector4i _ralign_helper(const GSVector4i& mask) const
|
|
||||||
{
|
|
||||||
GSVector4i v;
|
|
||||||
|
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
case Align_Inside:
|
|
||||||
v = add32(mask);
|
|
||||||
break;
|
|
||||||
case Align_Outside:
|
|
||||||
v = add32(mask.zwxy());
|
|
||||||
break;
|
|
||||||
case Align_NegInf:
|
|
||||||
v = *this;
|
|
||||||
break;
|
|
||||||
case Align_PosInf:
|
|
||||||
v = add32(mask.xyxy());
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return v.andnot(mask.xyxy());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Align the rect using mask values that already have one subtracted (1 << n - 1 aligns to 1 << n)
|
|
||||||
template<Align_Mode mode>
|
|
||||||
GSVector4i ralign_presub(const GSVector2i& a) const
|
|
||||||
{
|
|
||||||
return _ralign_helper<mode>(GSVector4i(a));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<Align_Mode mode>
|
|
||||||
GSVector4i ralign(const GSVector2i& a) const
|
|
||||||
{
|
|
||||||
// a must be 1 << n
|
|
||||||
|
|
||||||
return _ralign_helper<mode>(GSVector4i(a) - GSVector4i(1, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
ALWAYS_INLINE u32 rgba32() const
|
ALWAYS_INLINE u32 rgba32() const
|
||||||
{
|
{
|
||||||
GSVector4i v = *this;
|
GSVector4i v = *this;
|
||||||
|
@ -1347,19 +1303,6 @@ public:
|
||||||
return GSVector4(recip);
|
return GSVector4(recip);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int mode>
|
|
||||||
ALWAYS_INLINE GSVector4 round() const
|
|
||||||
{
|
|
||||||
if constexpr (mode == Round_NegInf)
|
|
||||||
return floor();
|
|
||||||
else if constexpr (mode == Round_PosInf)
|
|
||||||
return ceil();
|
|
||||||
else if constexpr (mode == Round_NearestInt)
|
|
||||||
return GSVector4(vrndnq_f32(v4s));
|
|
||||||
else
|
|
||||||
return GSVector4(vrndq_f32(v4s));
|
|
||||||
}
|
|
||||||
|
|
||||||
ALWAYS_INLINE GSVector4 floor() const { return GSVector4(vrndmq_f32(v4s)); }
|
ALWAYS_INLINE GSVector4 floor() const { return GSVector4(vrndmq_f32(v4s)); }
|
||||||
|
|
||||||
ALWAYS_INLINE GSVector4 ceil() const { return GSVector4(vrndpq_f32(v4s)); }
|
ALWAYS_INLINE GSVector4 ceil() const { return GSVector4(vrndpq_f32(v4s)); }
|
||||||
|
|
|
@ -187,50 +187,6 @@ public:
|
||||||
ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); }
|
ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); }
|
||||||
ALWAYS_INLINE bool rcontains(const GSVector4i& v) const { return rintersect(v).eq(v); }
|
ALWAYS_INLINE bool rcontains(const GSVector4i& v) const { return rintersect(v).eq(v); }
|
||||||
|
|
||||||
template<Align_Mode mode>
|
|
||||||
GSVector4i _ralign_helper(const GSVector4i& mask) const
|
|
||||||
{
|
|
||||||
GSVector4i v;
|
|
||||||
|
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
case Align_Inside:
|
|
||||||
v = add32(mask);
|
|
||||||
break;
|
|
||||||
case Align_Outside:
|
|
||||||
v = add32(mask.zwxy());
|
|
||||||
break;
|
|
||||||
case Align_NegInf:
|
|
||||||
v = *this;
|
|
||||||
break;
|
|
||||||
case Align_PosInf:
|
|
||||||
v = add32(mask.xyxy());
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return v.andnot(mask.xyxy());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Align the rect using mask values that already have one subtracted (1 << n - 1 aligns to 1 << n)
|
|
||||||
template<Align_Mode mode>
|
|
||||||
GSVector4i ralign_presub(const GSVector2i& v) const
|
|
||||||
{
|
|
||||||
return _ralign_helper<mode>(GSVector4i(v));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<Align_Mode mode>
|
|
||||||
GSVector4i ralign(const GSVector2i& v) const
|
|
||||||
{
|
|
||||||
// a must be 1 << n
|
|
||||||
|
|
||||||
return _ralign_helper<mode>(GSVector4i(v).sub32(GSVector4i(1, 1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
ALWAYS_INLINE u32 rgba32() const
|
ALWAYS_INLINE u32 rgba32() const
|
||||||
{
|
{
|
||||||
GSVector4i v = *this;
|
GSVector4i v = *this;
|
||||||
|
|
|
@ -141,47 +141,6 @@ public:
|
||||||
ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); }
|
ALWAYS_INLINE bool rintersects(const GSVector4i& v) const { return !rintersect(v).rempty(); }
|
||||||
ALWAYS_INLINE bool rcontains(const GSVector4i& v) const { return rintersect(v).eq(v); }
|
ALWAYS_INLINE bool rcontains(const GSVector4i& v) const { return rintersect(v).eq(v); }
|
||||||
|
|
||||||
template<Align_Mode mode>
|
|
||||||
GSVector4i _ralign_helper(const GSVector4i& mask) const
|
|
||||||
{
|
|
||||||
GSVector4i v;
|
|
||||||
|
|
||||||
switch (mode)
|
|
||||||
{
|
|
||||||
case Align_Inside:
|
|
||||||
v = add32(mask);
|
|
||||||
break;
|
|
||||||
case Align_Outside:
|
|
||||||
v = add32(mask.zwxy());
|
|
||||||
break;
|
|
||||||
case Align_NegInf:
|
|
||||||
v = *this;
|
|
||||||
break;
|
|
||||||
case Align_PosInf:
|
|
||||||
v = add32(mask.xyxy());
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return v.andnot(mask.xyxy());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Align the rect using mask values that already have one subtracted (1 << n - 1 aligns to 1 << n)
|
|
||||||
template<Align_Mode mode>
|
|
||||||
GSVector4i ralign_presub(const GSVector2i& v) const
|
|
||||||
{
|
|
||||||
return _ralign_helper<mode>(GSVector4i(v));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<Align_Mode mode>
|
|
||||||
GSVector4i ralign(const GSVector2i& v) const
|
|
||||||
{
|
|
||||||
// a must be 1 << n
|
|
||||||
|
|
||||||
return _ralign_helper<mode>(GSVector4i(v).sub32(GSVector4i(1, 1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -989,15 +948,9 @@ public:
|
||||||
return (v_ + v_) - (v_ * v_) * *this;
|
return (v_ + v_) - (v_ * v_) * *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int mode>
|
ALWAYS_INLINE GSVector4 floor() const { return GSVector4(_mm_round_ps(m, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC)); }
|
||||||
ALWAYS_INLINE GSVector4 round() const
|
|
||||||
{
|
|
||||||
return GSVector4(_mm_round_ps(m, mode));
|
|
||||||
}
|
|
||||||
|
|
||||||
ALWAYS_INLINE GSVector4 floor() const { return round<Round_NegInf>(); }
|
ALWAYS_INLINE GSVector4 ceil() const { return GSVector4(_mm_round_ps(m, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC)); }
|
||||||
|
|
||||||
ALWAYS_INLINE GSVector4 ceil() const { return round<Round_PosInf>(); }
|
|
||||||
|
|
||||||
ALWAYS_INLINE GSVector4 madd(const GSVector4& a_, const GSVector4& b_) const
|
ALWAYS_INLINE GSVector4 madd(const GSVector4& a_, const GSVector4& b_) const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue