diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2003-04-21 15:02:17 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2003-04-21 15:02:17 +0000 |
commit | e5b244ff7f984805c1bcc020342f1300f2639c71 (patch) | |
tree | 2662820db42730bb1f0269a2aef440309a81d083 /src/mesa/swrast/s_span.c | |
parent | 2780bb824f542c47d5412a3909eaa84ed3f13451 (diff) |
Implemented GL_EXT_depth_bounds_test.
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r-- | src/mesa/swrast/s_span.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 231e549c5ae..cce69b8c439 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -792,6 +792,13 @@ _swrast_write_index_span( GLcontext *ctx, struct sw_span *span) } } + /* Depth bounds test */ + if (ctx->Depth.BoundsTest && ctx->Visual.depthBits > 0) { + if (!_swrast_depth_bounds_test(ctx, span)) { + return; + } + } + #ifdef DEBUG if (span->arrayMask & SPAN_XY) { GLuint i; @@ -962,6 +969,13 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span) } } + /* Depth bounds test */ + if (ctx->Depth.BoundsTest && ctx->Visual.depthBits > 0) { + if (!_swrast_depth_bounds_test(ctx, span)) { + return; + } + } + #ifdef DEBUG if (span->arrayMask & SPAN_XY) { GLuint i; @@ -1168,6 +1182,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span) { const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask); SWcontext *swrast = SWRAST_CONTEXT(ctx); + const GLuint origInterpMask = span->interpMask; const GLuint origArrayMask = span->arrayMask; ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE || @@ -1253,6 +1268,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span) if (ctx->Stencil.Enabled) { if (!_swrast_stencil_and_ztest_span(ctx, span)) { + span->interpMask = origInterpMask; span->arrayMask = origArrayMask; return; } @@ -1262,6 +1278,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span) ASSERT(span->arrayMask & SPAN_Z); /* regular depth testing */ if (!_swrast_depth_test_span(ctx, span)) { + span->interpMask = origInterpMask; span->arrayMask = origArrayMask; return; } @@ -1275,6 +1292,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span) * the occlusion test. */ if (colorMask == 0x0) { + span->interpMask = origInterpMask; span->arrayMask = origArrayMask; return; } @@ -1336,11 +1354,12 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span) _swrast_blend_span(ctx, span, span->array->rgba); } + /* Color component masking */ if (colorMask != 0xffffffff) { _swrast_mask_rgba_span(ctx, span, span->array->rgba); } - + /* write pixels */ if (span->arrayMask & SPAN_XY) { /* array of pixel coords */ (*swrast->Driver.WriteRGBAPixels)(ctx, span->end, span->array->x, @@ -1365,6 +1384,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span) } } + span->interpMask = origInterpMask; span->arrayMask = origArrayMask; } |