summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkeithw <keithw>2002-01-21 15:59:52 +0000
committerkeithw <keithw>2002-01-21 15:59:52 +0000
commitab44a97ef03edca719418e665bc3c2ff0990281a (patch)
tree0c2a981aa22b402538038430d5fef9bd65cb5825
parentc83bcec33aff9fb1516bf09bdc75929d26e05820 (diff)
Fray Bentos' occlusion test patchX_4_2_0-20020123-preimport
-rw-r--r--xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c
index 132bea2ad..b783b1ea9 100644
--- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c
+++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c
@@ -160,6 +160,7 @@ static GLboolean get_occlusion_result( GLcontext *ctx )
GLboolean result;
LOCK_HARDWARE( fxMesa );
+ fxMesa->Glide.grFinish(); /* required to flush the FIFO - FB 21-01-2002 */
if (ctx->Depth.OcclusionTest) {
if (ctx->OcclusionResult) {
@@ -168,13 +169,12 @@ static GLboolean get_occlusion_result( GLcontext *ctx )
else {
FxI32 zfail, in;
fxMesa->Glide.grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, 4, &zfail);
- /*zfail = FX_grGetInteger_NoLock(GR_STATS_PIXELS_DEPTHFUNC_FAIL);*/
fxMesa->Glide.grGet(GR_STATS_PIXELS_IN, 4, &in);
- /*in = FX_grGetInteger_NoLock(GR_STATS_PIXELS_IN);*/
- if (in == zfail)
- result = GL_FALSE; /* geom was completely occluded */
- else
- result = GL_TRUE; /* all or part of geom was visible */
+ /* Geometry is occluded if there is no input (in == 0) */
+ /* or if all pixels failed the depth test (zfail == in) */
+ /* The < 1 is there because I have empirically seen cases where */
+ /* zfail > in.... go figure. FB - 21-01-2002. */
+ result = ((in - zfail) < 1 || in == 0) ? GL_FALSE : GL_TRUE;
}
}
else {