summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderPixel.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2025-03-15 14:30:19 +0100
committerGitHub <noreply@github.com>2025-03-15 14:30:19 +0100
commit3fb4084e25b1da3857d5d449dbc4417d731f3490 (patch)
treec4bbc9f7f1494d9f18936adc7e1ec50fed8c2d62 /Source/Core/VideoCommon/UberShaderPixel.cpp
parentfd2c6918fa395d79ba20e377176d74f65b9b39f8 (diff)
parent4e460a7968aa58365205bfb4a30e5df88ae0c1d4 (diff)
Merge pull request #13345 from Tilka/unswap_depth
Fix depth texture being incorrectly affected by swap table
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderPixel.cpp')
-rw-r--r--Source/Core/VideoCommon/UberShaderPixel.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/UberShaderPixel.cpp b/Source/Core/VideoCommon/UberShaderPixel.cpp
index f9674aa5a3..62cfd824d2 100644
--- a/Source/Core/VideoCommon/UberShaderPixel.cpp
+++ b/Source/Core/VideoCommon/UberShaderPixel.cpp
@@ -724,6 +724,7 @@ ShaderCode GenPixelShader(APIType api_type, const ShaderHostConfig& host_config,
out.Write("struct State {{\n"
" int4 Reg[4];\n"
+ " int4 RawTexColor;\n"
" int4 TexColor;\n"
" int AlphaBump;\n"
"}};\n"
@@ -1090,10 +1091,10 @@ ShaderCode GenPixelShader(APIType api_type, const ShaderHostConfig& host_config,
" uint sampler_num = {};\n",
BitfieldExtract<&TwoTevStageOrders::texmap_even>("ss.order"));
out.Write("\n"
- " int4 color = sampleTextureWrapper(sampler_num, tevcoord.xy, layer);\n"
+ " s.RawTexColor = sampleTextureWrapper(sampler_num, tevcoord.xy, layer);\n"
" uint swap = {};\n",
BitfieldExtract<&TevStageCombiner::AlphaCombiner::tswap>("ss.ac"));
- out.Write(" s.TexColor = Swizzle(swap, color);\n");
+ out.Write(" s.TexColor = Swizzle(swap, s.RawTexColor);\n");
out.Write(" }} else {{\n"
" // Texture is disabled\n"
" s.TexColor = int4(255, 255, 255, 255);\n"
@@ -1371,7 +1372,7 @@ ShaderCode GenPixelShader(APIType api_type, const ShaderHostConfig& host_config,
" int ztex = int(" I_ZBIAS "[1].w); // fixed bias\n"
"\n"
" // Whatever texture was in our last stage, it's now our depth texture\n"
- " ztex += idot(s.TexColor.xyzw, " I_ZBIAS "[0].xyzw);\n"
+ " ztex += idot(s.RawTexColor.xyzw, " I_ZBIAS "[0].xyzw);\n"
" ztex += (bpmem_ztex_op == 1u) ? zCoord : 0;\n"
" zCoord = ztex & 0xFFFFFF;\n"
" }}\n"