summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_triangle.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-06-13 02:37:27 +0000
committerBrian Paul <[email protected]>2003-06-13 02:37:27 +0000
commitb17a722ca3989e8563ee04cb2939f4835f8a171e (patch)
tree817c548199ee8e4a1ba2a0266f491b2b80b942d3 /src/mesa/swrast/s_triangle.c
parent0c0e583c01116c9e26ac99735e581ea2b842a88d (diff)
Implemented GL_ARB_occlusion_query (not 100% finalized).
Diffstat (limited to 'src/mesa/swrast/s_triangle.c')
-rw-r--r--src/mesa/swrast/s_triangle.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 43c131a6e75..0ce3459d544 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -899,13 +899,16 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span,
+/*
+ * Special tri function for occlusion testing
+ */
#define NAME occlusion_zless_triangle
#define DO_OCCLUSION_TEST
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
-#define SETUP_CODE \
- if (ctx->OcclusionResult) { \
- return; \
+#define SETUP_CODE \
+ if (ctx->OcclusionResult && !ctx->Occlusion.Active) { \
+ return; \
}
#define RENDER_SPAN( span ) \
GLuint i; \
@@ -913,7 +916,7 @@ fast_persp_span(GLcontext *ctx, struct sw_span *span,
GLdepth z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
ctx->OcclusionResult = GL_TRUE; \
- return; \
+ ctx->Occlusion.PassedCounter++; \
} \
span.z += span.zStep; \
}
@@ -1034,7 +1037,8 @@ _swrast_choose_triangle( GLcontext *ctx )
return;
}
- if (ctx->Depth.OcclusionTest &&
+ /* special case for occlusion testing */
+ if ((ctx->Depth.OcclusionTest || ctx->Occlusion.Active) &&
ctx->Depth.Test &&
ctx->Depth.Mask == GL_FALSE &&
ctx->Depth.Func == GL_LESS &&