diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2003-03-31 18:19:56 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2003-03-31 18:19:56 +0000 |
commit | 05b26510668fc1e5039c6c9088247f9b3c508cb7 (patch) | |
tree | 71a4fea8cdef352f9265b9081adf866e82925dc4 /src/mesa/tnl/t_imm_dlist.c | |
parent | 55b0ff2193ab772249442712381908f6503508e5 (diff) |
reduce memory needed for vertex attributes (allocate on demand)
Diffstat (limited to 'src/mesa/tnl/t_imm_dlist.c')
-rw-r--r-- | src/mesa/tnl/t_imm_dlist.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/tnl/t_imm_dlist.c b/src/mesa/tnl/t_imm_dlist.c index 07dd86b334..ff382c27c3 100644 --- a/src/mesa/tnl/t_imm_dlist.c +++ b/src/mesa/tnl/t_imm_dlist.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_dlist.c,v 1.47 2003/03/28 01:39:05 brianp Exp $ */ +/* $Id: t_imm_dlist.c,v 1.48 2003/03/31 18:19:56 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -76,6 +76,11 @@ build_normal_lengths( struct immediate *IM ) GLuint *flags = IM->Flag + IM->Start; GLuint count = IM->Count - IM->Start; +#if 0 + if (!IM->Attrib[VERT_ATTRIB_NORMAL]) + return; +#endif + if (!dest) { dest = IM->NormalLengthPtr = (GLfloat *) ALIGN_MALLOC( IMM_SIZE*sizeof(GLfloat), 32 ); if (!dest) return; @@ -174,7 +179,10 @@ _tnl_compile_cassette( GLcontext *ctx, struct immediate *IM ) node->MaterialOrMask = im->MaterialOrMask; node->MaterialAndMask = im->MaterialAndMask; - if (tnl->CalcDListNormalLengths) { + /* + * XXX always allocate VERT_ATTRIB_NORMAL array now??? + */ + if (tnl->CalcDListNormalLengths && IM->Attrib[VERT_ATTRIB_NORMAL]) { build_normal_lengths( im ); } |