diff options
Diffstat (limited to 'src/mesa/tnl/t_imm_eval.c')
-rw-r--r-- | src/mesa/tnl/t_imm_eval.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/tnl/t_imm_eval.c b/src/mesa/tnl/t_imm_eval.c index f9f942aeea..3b92d2a174 100644 --- a/src/mesa/tnl/t_imm_eval.c +++ b/src/mesa/tnl/t_imm_eval.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_eval.c,v 1.28 2003/03/01 01:50:27 brianp Exp $ */ +/* $Id: t_imm_eval.c,v 1.29 2003/03/31 18:19:57 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -453,6 +453,7 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) GLuint req = 0; GLuint purge_flags = 0; GLfloat (*coord)[4] = IM->Attrib[VERT_ATTRIB_POS] + IM->CopyStart; + GLuint attr; if (IM->AndFlag & VERT_BITS_EVAL_ANY) copycount = IM->Start - IM->CopyStart; /* just copy copied vertices */ @@ -503,6 +504,18 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM ) } } + /* Allocate vertex attribute storage now */ + for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { + if ((req & (1 << attr)) && !store->Attrib[attr]) { + store->Attrib[attr] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + if (!store->Attrib[attr]) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "evaluator processing"); + return; + } + } + } + + /* Perform the evaluations on active data elements. */ if (req & VERT_BIT_INDEX) { |