summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authorNeoBrainX <NeoBrainX@gmail.com>2013-01-08 16:51:01 +0100
committerNeoBrainX <NeoBrainX@gmail.com>2013-01-08 18:55:45 +0100
commitc80f6e8b84cd98120ad55a6830a68039ab6a2a48 (patch)
treea0be20fadae2b6f476e57deeaeab5e8d5ee00f81 /Source/Core/VideoCommon
parentb06f30f8452af075f5929e37f168e54bfd37083a (diff)
Reword a comment about early_ztest a bit.
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderGen.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
index dbc65669ff..e1507e8389 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp
@@ -1216,18 +1216,16 @@ static void WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode
WRITE(p, "ocol1 = 0;\n");
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 does depth test before texturing ONLY if depth value is
- // not updated during shader execution.
+ // HAXX: zcomploc (aka early_ztest) is a way to control whether depth test is done before
+ // or after texturing and alpha test. PC GPUs 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.
+ // Most importantly, PC GPUs do not allow writing to the z buffer without
+ // writing a color value (unless color writing is disabled altogether).
// 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.
- // this implemnetation is a trick to keep speed.
- // the correct, but slow, way to implement a correct zComploc is :
- // 1 - if zcomplock is enebled make a first pass, with color channel write disabled updating only
- // depth channel.
- // 2 - in the next pass disable depth chanel update, but proccess the color data normally
- // this way is the only CORRECT way to emulate perfectly the zcomplock behaviour
+ // even if the depth test fails the fragment could be alpha blended, but
+ // we don't have a choice.
if (!(bpmem.zcontrol.early_ztest && bpmem.zmode.updateenable))
{
WRITE(p, "discard;\n");
@@ -1236,7 +1234,6 @@ static void WriteAlphaTest(char *&p, API_TYPE ApiType,DSTALPHA_MODE dstAlphaMode
}
WRITE(p, "}\n");
-
}
static const char *tevFogFuncsTable[] =