From 814c1c9572c7152d009bb8be44c68f4d7d115f61 Mon Sep 17 00:00:00 2001 From: degasus Date: Mon, 19 Aug 2013 21:27:54 +0200 Subject: [PATCH] pixelShaderGen: also execute alpha test for always fail with late z test This should fix issue 6493, but maybe no real issue as this rendering just do nothing --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 7de5d12638..b4ad513d37 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -627,7 +627,10 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T AlphaTest::TEST_RESULT Pretest = bpmem.alpha_test.TestResult(); uid_data.Pretest = Pretest; - if (Pretest == AlphaTest::UNDETERMINED) + + // NOTE: Fragment may not be discarded if alpha test always fails and early depth test is enabled + // (in this case we need to write a depth value if depth test passes regardless of the alpha testing result) + if (Pretest == AlphaTest::UNDETERMINED || (Pretest == AlphaTest::FAIL && bpmem.UseLateDepthTest())) WriteAlphaTest(out, uid_data, ApiType, dstAlphaMode, per_pixel_depth);