diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2016-01-16 09:10:33 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2016-01-16 09:10:33 +0100 |
| commit | ea2765e0107c0e5e5254e77680c7a323a0ceda41 (patch) | |
| tree | 5a84bc28a13310f4a96917b72030486abafb2421 /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | 799fce0b03dd1c2e189ea93c4ff64c3cbf9b1cb4 (diff) | |
| parent | edebadc0936c13de5c70b149fd99cfea684d4adc (diff) | |
Merge pull request #3509 from stenzek/negative-indirect
PixelShaderGen: Manually wrap negative indirect texture coordinates
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 04c0df00c6..9b4cc8f46f 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -764,7 +764,7 @@ static void WriteStage(T& out, pixel_shader_uid_data* uid_data, int n, API_TYPE else if (bpmem.tevind[n].sw == ITW_0) out.Write("\twrappedcoord.x = 0;\n"); else - out.Write("\twrappedcoord.x = fixpoint_uv%d.x %% %s;\n", texcoord, tevIndWrapStart[bpmem.tevind[n].sw]); + out.Write("\twrappedcoord.x = fixpoint_uv%d.x & (%s - 1);\n", texcoord, tevIndWrapStart[bpmem.tevind[n].sw]); // wrap T if (bpmem.tevind[n].tw == ITW_OFF) @@ -772,7 +772,7 @@ static void WriteStage(T& out, pixel_shader_uid_data* uid_data, int n, API_TYPE else if (bpmem.tevind[n].tw == ITW_0) out.Write("\twrappedcoord.y = 0;\n"); else - out.Write("\twrappedcoord.y = fixpoint_uv%d.y %% %s;\n", texcoord, tevIndWrapStart[bpmem.tevind[n].tw]); + out.Write("\twrappedcoord.y = fixpoint_uv%d.y & (%s - 1);\n", texcoord, tevIndWrapStart[bpmem.tevind[n].tw]); if (bpmem.tevind[n].fb_addprev) // add previous tevcoord out.Write("\ttevcoord.xy += wrappedcoord + indtevtrans%d;\n", n); |
