summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-04-19 14:05:50 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-04-19 14:05:50 +0000
commitbf80e1ed620836e2ca0dd3f7d2d4cb187d17563d (patch)
tree8666b72f2ff74ac9499d2f9668212fcf4f2e3f5b /src/mesa/swrast/s_context.c
parent05be7ae1253ad68d80816395c3d09665e5619ebc (diff)
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.
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c11
1 files changed, 10 insertions, 1 deletions
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;