From 77df88727cb0a423dd5cb41498c2302d9df4fce7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Aug 2002 00:45:07 +0000 Subject: 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. --- src/mesa/swrast/s_context.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mesa/swrast/s_context.c') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 105b562d90..c80c92798b 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -1,4 +1,4 @@ -/* $Id: s_context.c,v 1.36 2002/07/09 01:22:52 brianp Exp $ */ +/* $Id: s_context.c,v 1.37 2002/08/07 00:45:07 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -513,10 +513,10 @@ _swrast_CreateContext( GLcontext *ctx ) for (i = 0 ; i < MAX_TEXTURE_UNITS ; i++) swrast->TextureSample[i] = _swrast_validate_texture_sample; - swrast->span = (struct sw_span *) MALLOC(sizeof(struct sw_span)); - if (!swrast->span) { - FREE(swrast); - return GL_FALSE; + swrast->span_data = MALLOC_STRUCT(span_arrays); + if (!swrast->span_data) { + FREE(swrast); + return GL_FALSE; } assert(ctx->Const.MaxTextureUnits > 0); @@ -525,7 +525,7 @@ _swrast_CreateContext( GLcontext *ctx ) swrast->TexelBuffer = (GLchan *) MALLOC(ctx->Const.MaxTextureUnits * MAX_WIDTH * 4 * sizeof(GLchan)); if (!swrast->TexelBuffer) { - FREE(swrast->span); + FREE(swrast->span_data); FREE(swrast); return GL_FALSE; } @@ -544,7 +544,7 @@ _swrast_DestroyContext( GLcontext *ctx ) _mesa_debug(ctx, "_swrast_DestroyContext\n"); } - FREE( swrast->span ); + FREE( swrast->span_data ); FREE( swrast->TexelBuffer ); FREE( swrast ); -- cgit v1.2.3