From bf80e1ed620836e2ca0dd3f7d2d4cb187d17563d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Apr 2002 14:05:50 +0000 Subject: Allocate a sw_span struct in the swrast context instead of allocating it on the stack frame in the point/line/triangle functions. (Klaus Niederkrueger) This should solve the performance problem Karl found on Windows. --- src/mesa/swrast/s_context.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (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 fa91f15a8f..96572aa063 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.30 2002/04/19 00:38:27 brianp Exp $ */ +/* $Id: s_context.c,v 1.31 2002/04/19 14:05:50 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -494,7 +494,14 @@ _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; + } + ctx->swrast_context = swrast; + return GL_TRUE; } @@ -507,6 +514,8 @@ _swrast_DestroyContext( GLcontext *ctx ) fprintf(stderr, "_swrast_DestroyContext\n"); } + FREE( swrast->span ); + FREE( swrast ); ctx->swrast_context = 0; -- cgit v1.2.3