vertexjit: Clamp through float pos during decode.

Rather than decoding it on read, better to decode it right away.
This commit is contained in:
Unknown W. Brackets 2022-09-01 23:11:58 -07:00
parent 5200208a84
commit 9f48ddb18c
5 changed files with 59 additions and 18 deletions

View file

@ -776,10 +776,11 @@ void VertexDecoder::Step_PosFloatSkin() const
void VertexDecoder::Step_PosS8Through() const
{
float *v = (float *)(decoded_ + decFmt.posoff);
const s8 *sv = (const s8*)(ptr_ + posoff);
const s8 *sv = (const s8 *)(ptr_ + posoff);
const u8 *uv = (const u8 *)(ptr_ + posoff);
v[0] = sv[0];
v[1] = sv[1];
v[2] = sv[2];
v[2] = uv[2];
}
void VertexDecoder::Step_PosS16Through() const
@ -794,9 +795,10 @@ void VertexDecoder::Step_PosS16Through() const
void VertexDecoder::Step_PosFloatThrough() const
{
u8 *v = (u8 *)(decoded_ + decFmt.posoff);
const u8 *fv = (const u8 *)(ptr_ + posoff);
memcpy(v, fv, 12);
float *v = (float *)(decoded_ + decFmt.posoff);
const float *fv = (const float *)(ptr_ + posoff);
memcpy(v, fv, 8);
v[2] = fv[2] > 65535.0f ? 65535.0f : (fv[2] < 0.0f ? 0.0f : fv[2]);
}
void VertexDecoder::Step_PosS8Morph() const