summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2012-03-22 22:10:23 +0100
committerPierre Bourdon <delroth@gmail.com>2012-03-22 22:10:23 +0100
commit339ee98e6258024622ef509aafe25ff46ad19341 (patch)
tree40de0ce00815b78150a5cd27b91b35774f0919d2 /Source/Core/VideoCommon/Src/PixelShaderGen.cpp
parent0ffc12bbfd6ac44b3030ec30f400a58e951087b7 (diff)
Add a comment before the zcomploc test explaining the implementation/hack
Diffstat (limited to 'Source/Core/VideoCommon/Src/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderGen.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
index 46ac264889..79afc45974 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
@@ -1198,6 +1198,16 @@ static bool WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode
WRITE(p, "ocol1 = 0;\n");
if (DepthTextureEnable)
WRITE(p, "depth = 1.f;\n");
+
+ // HAXX: zcomploc is a way to control whether depth test is done before
+ // or after texturing and alpha test. PC GPU have no way to support this
+ // feature properly as of 2012: depth buffer and depth test are not
+ // programmable and the depth test is always done after texturing.
+ //
+ // We implement "depth test before texturing" by discarding the fragment
+ // when the alpha test fail. This is not a correct implementation because
+ // even if the depth test fails the fragment could be alpha blended, but
+ // we don't have a choice.
if (!(bpmem.zcontrol.zcomploc && bpmem.zmode.updateenable))
{
WRITE(p, "discard;\n");