From 2feced2e332f29dd4ca500d76410e797403d562e Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Wed, 7 Jul 2021 16:35:50 -0700 Subject: Fix indirect textures when format is not ITF_8 --- Source/Core/VideoBackends/Software/Tev.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'Source/Core/VideoBackends/Software/Tev.cpp') diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp index 1d668acc29..f8af6325db 100644 --- a/Source/Core/VideoBackends/Software/Tev.cpp +++ b/Source/Core/VideoBackends/Software/Tev.cpp @@ -459,22 +459,22 @@ void Tev::Indirect(unsigned int stageNum, s32 s, s32 t) AlphaBump = AlphaBump & 0xf8; break; case IndTexFormat::ITF_5: - indcoord[0] = (indmap[TextureSampler::ALP_SMP] & 0x1f) + bias[0]; - indcoord[1] = (indmap[TextureSampler::BLU_SMP] & 0x1f) + bias[1]; - indcoord[2] = (indmap[TextureSampler::GRN_SMP] & 0x1f) + bias[2]; - AlphaBump = AlphaBump & 0xe0; + indcoord[0] = (indmap[TextureSampler::ALP_SMP] >> 3) + bias[0]; + indcoord[1] = (indmap[TextureSampler::BLU_SMP] >> 3) + bias[1]; + indcoord[2] = (indmap[TextureSampler::GRN_SMP] >> 3) + bias[2]; + AlphaBump = AlphaBump << 5; break; case IndTexFormat::ITF_4: - indcoord[0] = (indmap[TextureSampler::ALP_SMP] & 0x0f) + bias[0]; - indcoord[1] = (indmap[TextureSampler::BLU_SMP] & 0x0f) + bias[1]; - indcoord[2] = (indmap[TextureSampler::GRN_SMP] & 0x0f) + bias[2]; - AlphaBump = AlphaBump & 0xf0; + indcoord[0] = (indmap[TextureSampler::ALP_SMP] >> 4) + bias[0]; + indcoord[1] = (indmap[TextureSampler::BLU_SMP] >> 4) + bias[1]; + indcoord[2] = (indmap[TextureSampler::GRN_SMP] >> 4) + bias[2]; + AlphaBump = AlphaBump << 4; break; case IndTexFormat::ITF_3: - indcoord[0] = (indmap[TextureSampler::ALP_SMP] & 0x07) + bias[0]; - indcoord[1] = (indmap[TextureSampler::BLU_SMP] & 0x07) + bias[1]; - indcoord[2] = (indmap[TextureSampler::GRN_SMP] & 0x07) + bias[2]; - AlphaBump = AlphaBump & 0xf8; + indcoord[0] = (indmap[TextureSampler::ALP_SMP] >> 5) + bias[0]; + indcoord[1] = (indmap[TextureSampler::BLU_SMP] >> 5) + bias[1]; + indcoord[2] = (indmap[TextureSampler::GRN_SMP] >> 5) + bias[2]; + AlphaBump = AlphaBump << 3; break; default: PanicAlertFmt("Invalid indirect format {}", indirect.fmt); -- cgit v1.2.3