summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorMarkus Wick <markus+github@selfnet.de>2015-02-21 09:30:05 +0100
committerMarkus Wick <markus+github@selfnet.de>2015-02-21 09:30:05 +0100
commit5da28f394a723536525c0bf1cd5fc7e4a0d340c4 (patch)
treead6d277336b9da543f4ff77f47d7f009891b339e /Source/Core/VideoCommon/PixelShaderGen.cpp
parentec065eef8d43f93b02fe8f94e2fd30bc5f47f79c (diff)
parent355be1719ee5ac8487fa0a172d32b53e2279d9aa (diff)
Merge pull request #2083 from phire/zfreeze-regression
Fix regression with directx when zfreeze=true and ztest=false.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 7c76628dd4..e4efccaac9 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -275,8 +275,10 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
&& (g_ActiveConfig.bFastDepthCalc || bpmem.alpha_test.TestResult() == AlphaTest::UNDETERMINED)
// We can't allow early_ztest for zfreeze because depth is overridden per-pixel.
// This means it's impossible for zcomploc to be emulated on a zfrozen polygon.
- && !bpmem.genMode.zfreeze;
- const bool per_pixel_depth = (bpmem.ztex2.op != ZTEXTURE_DISABLE && bpmem.UseLateDepthTest()) || (!g_ActiveConfig.bFastDepthCalc && bpmem.zmode.testenable && !forced_early_z) || bpmem.genMode.zfreeze;
+ && !(bpmem.zmode.testenable && bpmem.genMode.zfreeze);
+ const bool per_pixel_depth = (bpmem.ztex2.op != ZTEXTURE_DISABLE && bpmem.UseLateDepthTest())
+ || (!g_ActiveConfig.bFastDepthCalc && bpmem.zmode.testenable && !forced_early_z)
+ || (bpmem.zmode.testenable && bpmem.genMode.zfreeze);
if (forced_early_z)
{
@@ -369,7 +371,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
out.Write("void main(\n");
out.Write(" out float4 ocol0 : SV_Target0,%s%s\n in float4 rawpos : SV_Position,\n",
dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND ? "\n out float4 ocol1 : SV_Target1," : "",
- (per_pixel_depth && bpmem.zmode.testenable) ? "\n out float depth : SV_Depth," : "");
+ per_pixel_depth ? "\n out float depth : SV_Depth," : "");
out.Write(" in centroid float4 colors_0 : COLOR0,\n");
out.Write(" in centroid float4 colors_1 : COLOR1\n");