From b17a722ca3989e8563ee04cb2939f4835f8a171e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 13 Jun 2003 02:37:27 +0000 Subject: Implemented GL_ARB_occlusion_query (not 100% finalized). --- src/mesa/swrast/s_triangle.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/mesa/swrast/s_triangle.c') 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 && -- cgit v1.2.3