From ba6564b0b59a9b72c79aad1cf4048610e2852e92 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 28 Dec 2012 14:48:04 -0600 Subject: [PATCH] Missed a write to depth before discard in PreAlphaTest --- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index c642b61da6..6e263aa7c3 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -782,10 +782,17 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType { // alpha test will always fail, so restart the shader and just make it an empty function WRITE(p, "\tocol0 = float4(0.0f);\n"); + if(DepthTextureEnable) + WRITE(p, "\tdepth = 1.f;\n"); if(dstAlphaMode == DSTALPHA_DUAL_SOURCE_BLEND) WRITE(p, "\tocol1 = float4(0.0f);\n"); - if(ApiType == API_OPENGL && dstAlphaMode != DSTALPHA_DUAL_SOURCE_BLEND) - WRITE(p, "\tgl_FragData[0] = ocol0;\n"); + if (ApiType == API_OPENGL) + { + if (DepthTextureEnable) + WRITE(p, "\tgl_FragDepth = depth;\n"); + if (dstAlphaMode != DSTALPHA_DUAL_SOURCE_BLEND) + WRITE(p, "\tgl_FragData[0] = ocol0;\n"); + } WRITE(p, "\tdiscard;\n"); if(ApiType != API_D3D11) WRITE(p, "\treturn;\n");