summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/Tev.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2016-01-16 09:10:33 +0100
committerPierre Bourdon <delroth@gmail.com>2016-01-16 09:10:33 +0100
commitea2765e0107c0e5e5254e77680c7a323a0ceda41 (patch)
tree5a84bc28a13310f4a96917b72030486abafb2421 /Source/Core/VideoBackends/Software/Tev.cpp
parent799fce0b03dd1c2e189ea93c4ff64c3cbf9b1cb4 (diff)
parentedebadc0936c13de5c70b149fd99cfea684d4adc (diff)
Merge pull request #3509 from stenzek/negative-indirect
PixelShaderGen: Manually wrap negative indirect texture coordinates
Diffstat (limited to 'Source/Core/VideoBackends/Software/Tev.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/Tev.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp
index 939b9f98a4..a09b9cbb00 100644
--- a/Source/Core/VideoBackends/Software/Tev.cpp
+++ b/Source/Core/VideoBackends/Software/Tev.cpp
@@ -374,15 +374,15 @@ static inline s32 WrapIndirectCoord(s32 coord, int wrapMode)
case ITW_OFF:
return coord;
case ITW_256:
- return (coord % (256 << 7));
+ return (coord & ((256 << 7) - 1));
case ITW_128:
- return (coord % (128 << 7));
+ return (coord & ((128 << 7) - 1));
case ITW_64:
- return (coord % (64 << 7));
+ return (coord & ((64 << 7) - 1));
case ITW_32:
- return (coord % (32 << 7));
+ return (coord & ((32 << 7) - 1));
case ITW_16:
- return (coord % (16 << 7));
+ return (coord & ((16 << 7) - 1));
case ITW_0:
return 0;
default: