Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
PixelShaderGen: Do not write depth in pixel shader if depth testing (…
…and thus writing) is not enabled. Should improve performance quite a bit in some cases.

Fixes issue 6474.
  • Loading branch information
NeoBrainX authored and NeoBrainX committed Aug 12, 2013
1 parent 7f3c06d commit 4c22e12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Core/VideoCommon/Src/PixelShaderGen.cpp
Expand Up @@ -259,7 +259,7 @@ static void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_TYPE Api
unsigned int numTexgen = bpmem.genMode.numtexgens;

const bool forced_early_z = g_ActiveConfig.backend_info.bSupportsEarlyZ && bpmem.UseEarlyDepthTest() && (g_ActiveConfig.bFastDepthCalc || bpmem.alpha_test.TestResult() == AlphaTest::UNDETERMINED);
const bool per_pixel_depth = (bpmem.ztex2.op != ZTEXTURE_DISABLE && bpmem.UseLateDepthTest()) || (!g_ActiveConfig.bFastDepthCalc && !forced_early_z);
const bool per_pixel_depth = (bpmem.ztex2.op != ZTEXTURE_DISABLE && bpmem.UseLateDepthTest()) || (!g_ActiveConfig.bFastDepthCalc && bpmem.zmode.testenable && !forced_early_z);

out.Write("//Pixel Shader for TEV stages\n");
out.Write("//%i TEV stages, %i texgens, %i IND stages\n",
Expand Down

0 comments on commit 4c22e12

Please sign in to comment.