diff options
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r-- | src/mesa/swrast/s_span.c | 24 |
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. */ |