summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/Tev.cpp
diff options
context:
space:
mode:
authorTony Wasserka <NeoBrainX@gmail.com>2013-10-10 21:09:00 +0200
committerTony Wasserka <NeoBrainX@gmail.com>2014-03-14 22:31:18 +0100
commit0238a568162099f0ee1db3d584e42db734f4e509 (patch)
treeeea6fbc136ebe34e84aa131c1e4ee40860370016 /Source/Core/VideoBackends/Software/Tev.cpp
parentc13a5c38e9ab997f21b84c2ce64772b66cc3cfc9 (diff)
PixelShaderGen: Change indirect texture matrix uniforms to use integers.
Diffstat (limited to 'Source/Core/VideoBackends/Software/Tev.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/Tev.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp
index 0c80e04c93..49899f642c 100644
--- a/Source/Core/VideoBackends/Software/Tev.cpp
+++ b/Source/Core/VideoBackends/Software/Tev.cpp
@@ -544,19 +544,21 @@ void Tev::Indirect(unsigned int stageNum, s32 s, s32 t)
switch (indirect.mid & 12)
{
case 0:
- shift = 3 + (17 - scale);
- indtevtrans[0] = indmtx.col0.ma * indcoord[0] + indmtx.col1.mc * indcoord[1] + indmtx.col2.me * indcoord[2];
- indtevtrans[1] = indmtx.col0.mb * indcoord[0] + indmtx.col1.md * indcoord[1] + indmtx.col2.mf * indcoord[2];
+ // matrix values are S0.10, output format is S17.7, so divide by 8
+ shift = (17 - scale);
+ indtevtrans[0] = (indmtx.col0.ma * indcoord[0] + indmtx.col1.mc * indcoord[1] + indmtx.col2.me * indcoord[2]) >> 3;
+ indtevtrans[1] = (indmtx.col0.mb * indcoord[0] + indmtx.col1.md * indcoord[1] + indmtx.col2.mf * indcoord[2]) >> 3;
break;
case 4: // s matrix
- shift = 8 + (17 - scale);
- indtevtrans[0] = s * indcoord[0];
- indtevtrans[1] = t * indcoord[0];
+ // s is S17.7, matrix elements are divided by 256, output is S17.7, so divide by 256. - TODO: Maybe, since s is actually stored as S24, we should divide by 256*64?
+ shift = (17 - scale);
+ indtevtrans[0] = s * indcoord[0] / 256;
+ indtevtrans[1] = t * indcoord[0] / 256;
break;
case 8: // t matrix
- shift = 8 + (17 - scale);
- indtevtrans[0] = s * indcoord[1];
- indtevtrans[1] = t * indcoord[1];
+ shift = (17 - scale);
+ indtevtrans[0] = s * indcoord[1] / 256;
+ indtevtrans[1] = t * indcoord[1] / 256;
break;
default:
return;