mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
softgpu: Reduce size of VertexData texture coords.
There's no real benefit to this with only two values. Not much of a gain perf wise, but still good to transfer less data.
This commit is contained in:
parent
a0515bf5ca
commit
b2e6a086dc
2 changed files with 3 additions and 32 deletions
27
GPU/Math3D.h
27
GPU/Math3D.h
|
@ -57,22 +57,10 @@ inline static T VecClamp(const T &v, const T &low, const T &high)
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
class Vec2
|
||||
{
|
||||
class Vec2 {
|
||||
public:
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
T x,y;
|
||||
};
|
||||
#if defined(_M_SSE)
|
||||
__m128i ivec;
|
||||
__m128 vec;
|
||||
#elif PPSSPP_ARCH(ARM64_NEON)
|
||||
int32x4_t ivec;
|
||||
float32x4_t vec;
|
||||
#endif
|
||||
struct {
|
||||
T x,y;
|
||||
};
|
||||
|
||||
T* AsArray() { return &x; }
|
||||
|
@ -81,15 +69,6 @@ public:
|
|||
Vec2() {}
|
||||
Vec2(const T a[2]) : x(a[0]), y(a[1]) {}
|
||||
Vec2(const T& _x, const T& _y) : x(_x), y(_y) {}
|
||||
#if defined(_M_SSE)
|
||||
Vec2(const __m128 &_vec) : vec(_vec) {}
|
||||
Vec2(const __m128i &_ivec) : ivec(_ivec) {}
|
||||
#elif PPSSPP_ARCH(ARM64_NEON)
|
||||
Vec2(const float32x4_t &_vec) : vec(_vec) {}
|
||||
#if !defined(_MSC_VER)
|
||||
Vec2(const int32x4_t &_ivec) : ivec(_ivec) {}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
template<typename T2>
|
||||
Vec2<T2> Cast() const
|
||||
|
|
|
@ -78,14 +78,6 @@ static inline Vec3<int> Interpolate(const Vec3<int> &c0, const Vec3<int> &c1, co
|
|||
#endif
|
||||
}
|
||||
|
||||
static inline Vec2<float> Interpolate(const Vec2<float> &c0, const Vec2<float> &c1, const Vec2<float> &c2, int w0, int w1, int w2, float wsum) {
|
||||
#if defined(_M_SSE) && !PPSSPP_ARCH(X86)
|
||||
return Vec2<float>(Interpolate(c0.vec, c1.vec, c2.vec, w0, w1, w2, wsum));
|
||||
#else
|
||||
return (c0 * w0 + c1 * w1 + c2 * w2) * wsum;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline Vec4<float> Interpolate(const float &c0, const float &c1, const float &c2, const Vec4<float> &w0, const Vec4<float> &w1, const Vec4<float> &w2, const Vec4<float> &wsum_recip) {
|
||||
#if defined(_M_SSE) && !PPSSPP_ARCH(X86)
|
||||
__m128 v = _mm_mul_ps(w0.vec, _mm_set1_ps(c0));
|
||||
|
|
Loading…
Add table
Reference in a new issue