summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-06-13 02:37:27 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-06-13 02:37:27 +0000
commitb17a722ca3989e8563ee04cb2939f4835f8a171e (patch)
tree817c548199ee8e4a1ba2a0266f491b2b80b942d3 /src/mesa/swrast/s_span.c
parent0c0e583c01116c9e26ac99735e581ea2b842a88d (diff)
Implemented GL_ARB_occlusion_query (not 100% finalized).
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index cce69b8c43..59e89252a0 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -841,6 +841,14 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span)
/* if we get here, something passed the depth test */
ctx->OcclusionResult = GL_TRUE;
+#if FEATURE_ARB_occlusion_query
+ if (ctx->Occlusion.Active) {
+ GLuint i;
+ for (i = 0; i < span->end; i++)
+ ctx->Occlusion.PassedCounter += span->array->mask[i];
+ }
+#endif
+
/* we have to wait until after occlusion to do this test */
if (ctx->Color.DrawBuffer == GL_NONE || ctx->Color.IndexMask == 0) {
/* write no pixels */
@@ -1046,6 +1054,14 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
/* if we get here, something passed the depth test */
ctx->OcclusionResult = GL_TRUE;
+#if FEATURE_ARB_occlusion_query
+ if (ctx->Occlusion.Active) {
+ GLuint i;
+ for (i = 0; i < span->end; i++)
+ ctx->Occlusion.PassedCounter += span->array->mask[i];
+ }
+#endif
+
/* can't abort span-writing until after occlusion testing */
if (colorMask == 0x0) {
span->interpMask = origInterpMask;
@@ -1288,6 +1304,14 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span)
/* if we get here, some fragments passed the depth test */
ctx->OcclusionResult = GL_TRUE;
+#if FEATURE_ARB_occlusion_query
+ if (ctx->Occlusion.Active) {
+ GLuint i;
+ for (i = 0; i < span->end; i++)
+ ctx->Occlusion.PassedCounter += span->array->mask[i];
+ }
+#endif
+
/* We had to wait until now to check for glColorMask(F,F,F,F) because of
* the occlusion test.
*/