summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/UberShaderPixel.cpp
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2025-02-11 18:57:30 +0000
committerTillmann Karras <tilkax@gmail.com>2025-02-25 18:45:01 +0000
commit4e460a7968aa58365205bfb4a30e5df88ae0c1d4 (patch)
treefc40331bc5952865522f9843854362a91783d723 /Source/Core/VideoCommon/UberShaderPixel.cpp
parent359fb51d640d4c93b4c64c764b462892f78350b2 (diff)
UberShaderPixel: use unswapped texture samples for depth
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"