summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-08-07 00:45:07 +0000
committerBrian Paul <[email protected]>2002-08-07 00:45:07 +0000
commit77df88727cb0a423dd5cb41498c2302d9df4fce7 (patch)
tree98234cef23e87e196b3628095196daed47bf6dce /src/mesa/swrast/s_context.c
parent2353e96c320d4bd26d10dc29b57df3e9f882e6d3 (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_context.c')
-rw-r--r--src/mesa/swrast/s_context.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 105b562d90f..c80c92798b5 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 );