mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
PixelShaderGen: use unswapped texture samples for depth
This commit is contained in:
@ -1104,8 +1104,8 @@ ShaderCode GeneratePixelShaderCode(APIType api_type, const ShaderHostConfig& hos
|
|||||||
|
|
||||||
out.Write("\tint4 c0 = " I_COLORS "[1], c1 = " I_COLORS "[2], c2 = " I_COLORS
|
out.Write("\tint4 c0 = " I_COLORS "[1], c1 = " I_COLORS "[2], c2 = " I_COLORS
|
||||||
"[3], prev = " I_COLORS "[0];\n"
|
"[3], prev = " I_COLORS "[0];\n"
|
||||||
"\tint4 rastemp = int4(0, 0, 0, 0), textemp = int4(0, 0, 0, 0), konsttemp = int4(0, 0, "
|
"\tint4 rastemp = int4(0, 0, 0, 0), rawtextemp = int4(0, 0, 0, 0), "
|
||||||
"0, 0);\n"
|
"textemp = int4(0, 0, 0, 0), konsttemp = int4(0, 0, 0, 0);\n"
|
||||||
"\tint3 comp16 = int3(1, 256, 0), comp24 = int3(1, 256, 256*256);\n"
|
"\tint3 comp16 = int3(1, 256, 0), comp24 = int3(1, 256, 256*256);\n"
|
||||||
"\tint alphabump=0;\n"
|
"\tint alphabump=0;\n"
|
||||||
"\tint3 tevcoord=int3(0, 0, 0);\n"
|
"\tint3 tevcoord=int3(0, 0, 0);\n"
|
||||||
@ -1291,7 +1291,7 @@ ShaderCode GeneratePixelShaderCode(APIType api_type, const ShaderHostConfig& hos
|
|||||||
// use the texture input of the last texture stage (textemp), hopefully this has been read and
|
// use the texture input of the last texture stage (textemp), hopefully this has been read and
|
||||||
// is in correct format...
|
// is in correct format...
|
||||||
out.SetConstantsUsed(C_ZBIAS, C_ZBIAS + 1);
|
out.SetConstantsUsed(C_ZBIAS, C_ZBIAS + 1);
|
||||||
out.Write("\tzCoord = idot(" I_ZBIAS "[0].xyzw, textemp.xyzw) + " I_ZBIAS "[1].w {};\n",
|
out.Write("\tzCoord = idot(" I_ZBIAS "[0].xyzw, rawtextemp.xyzw) + " I_ZBIAS "[1].w {};\n",
|
||||||
(uid_data->ztex_op == ZTexOp::Add) ? "+ zCoord" : "");
|
(uid_data->ztex_op == ZTexOp::Add) ? "+ zCoord" : "");
|
||||||
out.Write("\tzCoord = zCoord & 0xFFFFFF;\n");
|
out.Write("\tzCoord = zCoord & 0xFFFFFF;\n");
|
||||||
}
|
}
|
||||||
@ -1614,8 +1614,9 @@ static void WriteStage(ShaderCode& out, const pixel_shader_uid_data* uid_data, i
|
|||||||
if (stage.tevorders_enable && uid_data->genMode_numtexgens > 0)
|
if (stage.tevorders_enable && uid_data->genMode_numtexgens > 0)
|
||||||
{
|
{
|
||||||
// Generate swizzle string to represent the texture color channel swapping
|
// Generate swizzle string to represent the texture color channel swapping
|
||||||
out.Write("\ttextemp = sampleTextureWrapper({}u, tevcoord.xy, layer).{}{}{}{};\n",
|
out.Write("\trawtextemp = sampleTextureWrapper({}u, tevcoord.xy, layer);\n",
|
||||||
stage.tevorders_texmap, rgba_swizzle[stage.tex_swap_r],
|
stage.tevorders_texmap);
|
||||||
|
out.Write("\ttextemp = rawtextemp.{}{}{}{};\n", rgba_swizzle[stage.tex_swap_r],
|
||||||
rgba_swizzle[stage.tex_swap_g], rgba_swizzle[stage.tex_swap_b],
|
rgba_swizzle[stage.tex_swap_g], rgba_swizzle[stage.tex_swap_b],
|
||||||
rgba_swizzle[stage.tex_swap_a]);
|
rgba_swizzle[stage.tex_swap_a]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user