From 470d2f0f4efe18652f3bcf6b738d8511cea332fd Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 1 Sep 2022 23:22:52 -0700 Subject: [PATCH] vertexjit: Remove unused ReadUV() cases. --- GPU/Common/VertexDecoderCommon.cpp | 1 + GPU/Common/VertexDecoderCommon.h | 34 ++++-------------------------- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/GPU/Common/VertexDecoderCommon.cpp b/GPU/Common/VertexDecoderCommon.cpp index e8d3310eed..6ac9806c01 100644 --- a/GPU/Common/VertexDecoderCommon.cpp +++ b/GPU/Common/VertexDecoderCommon.cpp @@ -1265,6 +1265,7 @@ void VertexDecoder::SetVertexType(u32 fmt, const VertexDecoderOptions &options, } _assert_msg_(decFmt.posfmt == DEC_FLOAT_3, "Reader only supports float pos"); + _assert_msg_(decFmt.uvfmt == DEC_FLOAT_2 || decFmt.uvfmt == DEC_NONE, "Reader only supports float UV"); // Attempt to JIT as well. But only do that if the main CPU JIT is enabled, in order to aid // debugging attempts - if the main JIT doesn't work, this one won't do any better, probably. diff --git a/GPU/Common/VertexDecoderCommon.h b/GPU/Common/VertexDecoderCommon.h index a12eb250c4..3d6377a86c 100644 --- a/GPU/Common/VertexDecoderCommon.h +++ b/GPU/Common/VertexDecoderCommon.h @@ -171,36 +171,10 @@ public: } void ReadUV(float uv[2]) const { - switch (decFmt_.uvfmt) { - case DEC_U8_2: - { - const u8 *b = (const u8 *)(data_ + decFmt_.uvoff); - uv[0] = b[0] * (1.f / 128.f); - uv[1] = b[1] * (1.f / 128.f); - } - break; - - case DEC_U16_2: - { - const u16 *s = (const u16 *)(data_ + decFmt_.uvoff); - uv[0] = s[0] * (1.f / 32768.f); - uv[1] = s[1] * (1.f / 32768.f); - } - break; - - case DEC_FLOAT_2: - { - const float *f = (const float *)(data_ + decFmt_.uvoff); - uv[0] = f[0]; - uv[1] = f[1]; - } - break; - - default: - ERROR_LOG_REPORT_ONCE(fmtuv, G3D, "Reader: Unsupported UV Format %d", decFmt_.uvfmt); - memset(uv, 0, sizeof(float) * 2); - break; - } + // Only DEC_FLOAT_2 is supported. + const float *f = (const float *)(data_ + decFmt_.uvoff); + uv[0] = f[0]; + uv[1] = f[1]; } void ReadColor0(float color[4]) const {