From b0e90cc839c6b7fcd3bd76759862eb3bc423e50a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 3 Apr 2003 21:01:33 +0000 Subject: more memory-related fixes --- src/mesa/tnl/t_imm_fixup.c | 6 ++++++ src/mesa/tnl/t_vb_program.c | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/tnl/t_imm_fixup.c b/src/mesa/tnl/t_imm_fixup.c index b8c1bf4e72..7fb4d4753e 100644 --- a/src/mesa/tnl/t_imm_fixup.c +++ b/src/mesa/tnl/t_imm_fixup.c @@ -544,6 +544,12 @@ _tnl_fixup_compiled_cassette( GLcontext *ctx, struct immediate *IM ) for (attr = 1; attr < VERT_ATTRIB_MAX; attr++) { /* skip 0 (POS) */ const GLuint attrBit = 1 << attr; if (fixup & attrBit) { + if (!IM->Attrib[attr]) { + IM->Attrib[attr] = _mesa_malloc(IMM_SIZE * 4 * sizeof(GLfloat)); + if (!IM->Attrib[attr]) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "vertex processing"); + } + } if (attr == VERT_ATTRIB_COLOR0) { /* special case, darn */ if (IM->CopyOrFlag & VERT_BIT_COLOR0) diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 5a8dcb982a..045769c186 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -1,10 +1,8 @@ -/* $Id: t_vb_program.c,v 1.18 2003/03/01 01:50:27 brianp Exp $ */ - /* * Mesa 3-D graphics library * Version: 5.1 * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -136,7 +134,7 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage ) if (VB->Flag) { /* the traditional glBegin/glVertex/glEnd case */ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { - if (attr == 0 || (VB->Flag[i] & (1 << attr))) { + if (attr == 0 || (program->InputsRead & (1 << attr))) { COPY_4V(machine->Registers[VP_INPUT_REG_START + attr], VB->AttribPtr[attr]->data[i]); } -- cgit v1.2.3