softgpu: Remove useless switch by UV gen mode.

They're all handled earlier now, and the switch is on a value & 3, so the
default wasn't even possible.
This commit is contained in:
Unknown W. Brackets 2021-12-04 15:33:56 -08:00
parent ff94974df9
commit 48e9404419

View File

@ -205,12 +205,8 @@ static inline void GetTexelCoordinatesQuad(int level, float in_s, float in_t, in
}
static inline void GetTextureCoordinates(const VertexData& v0, const VertexData& v1, const float p, float &s, float &t) {
switch (gstate.getUVGenMode()) {
case GE_TEXMAP_TEXTURE_COORDS:
case GE_TEXMAP_UNKNOWN:
case GE_TEXMAP_ENVIRONMENT_MAP:
case GE_TEXMAP_TEXTURE_MATRIX:
{
// All UV gen modes, by the time they get here, behave the same.
// TODO: What happens if vertex has no texture coordinates?
// Note that for environment mapping, texture coordinates have been calculated during lighting
float q0 = 1.f / v0.clippos.w;
@ -222,25 +218,12 @@ static inline void GetTextureCoordinates(const VertexData& v0, const VertexData&
s = (v0.texturecoords.s() * wq0 + v1.texturecoords.s() * wq1) * q_recip;
t = (v0.texturecoords.t() * wq0 + v1.texturecoords.t() * wq1) * q_recip;
}
break;
default:
ERROR_LOG_REPORT(G3D, "Software: Unsupported texture mapping mode %x!", gstate.getUVGenMode());
s = 0.0f;
t = 0.0f;
break;
}
}
static inline void GetTextureCoordinates(const VertexData& v0, const VertexData& v1, const VertexData& v2, const Vec4<int> &w0, const Vec4<int> &w1, const Vec4<int> &w2, const Vec4<float> &wsum_recip, Vec4<float> &s, Vec4<float> &t)
{
switch (gstate.getUVGenMode()) {
case GE_TEXMAP_TEXTURE_COORDS:
case GE_TEXMAP_UNKNOWN:
case GE_TEXMAP_ENVIRONMENT_MAP:
case GE_TEXMAP_TEXTURE_MATRIX:
{
static inline void GetTextureCoordinates(const VertexData &v0, const VertexData &v1, const VertexData &v2, const Vec4<int> &w0, const Vec4<int> &w1, const Vec4<int> &w2, const Vec4<float> &wsum_recip, Vec4<float> &s, Vec4<float> &t) {
// All UV gen modes, by the time they get here, behave the same.
// TODO: What happens if vertex has no texture coordinates?
// Note that for environment mapping, texture coordinates have been calculated during lighting
// Note that for environment mapping, texture coordinates have been calculated during lighting.
float q0 = 1.f / v0.clippos.w;
float q1 = 1.f / v1.clippos.w;
float q2 = 1.f / v2.clippos.w;
@ -252,14 +235,6 @@ static inline void GetTextureCoordinates(const VertexData& v0, const VertexData&
s = Interpolate(v0.texturecoords.s(), v1.texturecoords.s(), v2.texturecoords.s(), wq0, wq1, wq2, q_recip);
t = Interpolate(v0.texturecoords.t(), v1.texturecoords.t(), v2.texturecoords.t(), wq0, wq1, wq2, q_recip);
}
break;
default:
ERROR_LOG_REPORT(G3D, "Software: Unsupported texture mapping mode %x!", gstate.getUVGenMode());
s = Vec4<float>::AssignToAll(0.0f);
t = Vec4<float>::AssignToAll(0.0f);
break;
}
}
static inline void SetPixelDepth(int x, int y, u16 value)
{