diff options
author | Brian Paul <[email protected]> | 2002-08-07 00:45:07 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-08-07 00:45:07 +0000 |
commit | 77df88727cb0a423dd5cb41498c2302d9df4fce7 (patch) | |
tree | 98234cef23e87e196b3628095196daed47bf6dce /src/mesa/swrast/s_depth.c | |
parent | 2353e96c320d4bd26d10dc29b57df3e9f882e6d3 (diff) |
struct sw_span is again allocated on the stack, but the arrays of span
data are broken out into a new struct span_arrays which is allocated
per-context (to avoid huge stack allocations - a problem on Windows).
This lets us use span.redStep instead of span->redStep (for example) to
hopefully get slightly better performance in the triangle functions.
Diffstat (limited to 'src/mesa/swrast/s_depth.c')
-rw-r--r-- | src/mesa/swrast/s_depth.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 0c0a5b6fe18..e7517b1e9ed 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -1,4 +1,4 @@ -/* $Id: s_depth.c,v 1.22 2002/04/19 00:38:27 brianp Exp $ */ +/* $Id: s_depth.c,v 1.23 2002/08/07 00:45:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -549,9 +549,11 @@ depth_test_span( GLcontext *ctx, struct sw_span *span) GLdepth zbuffer[MAX_WIDTH]; GLuint passed; (*swrast->Driver.ReadDepthSpan)(ctx, n, x, y, zbuffer); - passed = depth_test_span32(ctx, n, zbuffer, span->zArray, span->mask); + passed = depth_test_span32(ctx, n, zbuffer, span->array->z, + span->array->mask); ASSERT(swrast->Driver.WriteDepthSpan); - (*swrast->Driver.WriteDepthSpan)(ctx, n, x, y, zbuffer, span->mask); + (*swrast->Driver.WriteDepthSpan)(ctx, n, x, y, zbuffer, + span->array->mask); if (passed < n) span->writeAll = GL_FALSE; return passed; @@ -561,11 +563,11 @@ depth_test_span( GLcontext *ctx, struct sw_span *span) /* software depth buffer */ if (ctx->Visual.depthBits <= 16) { GLushort *zptr = (GLushort *) Z_ADDRESS16(ctx, x, y); - passed = depth_test_span16(ctx, n, zptr, span->zArray, span->mask); + passed = depth_test_span16(ctx, n, zptr, span->array->z, span->array->mask); } else { GLuint *zptr = (GLuint *) Z_ADDRESS32(ctx, x, y); - passed = depth_test_span32(ctx, n, zptr, span->zArray, span->mask); + passed = depth_test_span32(ctx, n, zptr, span->array->z, span->array->mask); } #if 1 if (passed < span->end) { @@ -1321,10 +1323,10 @@ depth_test_pixels( GLcontext *ctx, struct sw_span *span ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLuint n = span->end; - const GLint *x = span->xArray; - const GLint *y = span->yArray; - const GLdepth *z = span->zArray; - GLubyte *mask = span->mask; + const GLint *x = span->array->x; + const GLint *y = span->array->y; + const GLdepth *z = span->array->z; + GLubyte *mask = span->array->mask; if (swrast->Driver.ReadDepthPixels) { /* read depth values from hardware Z buffer */ |