Skip to content

Commit

Permalink
vertexjit: Remove unused ReadUV() cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Sep 2, 2022
1 parent f2d5d66 commit 470d2f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 30 deletions.
1 change: 1 addition & 0 deletions GPU/Common/VertexDecoderCommon.cpp
Expand Up @@ -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.
Expand Down
34 changes: 4 additions & 30 deletions GPU/Common/VertexDecoderCommon.h
Expand Up @@ -171,36 +171,10 @@ class VertexReader {
}

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 {
Expand Down

0 comments on commit 470d2f0

Please sign in to comment.