From 86b842790b720cd6b1499ce8edca8a4e9c8dc029 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 14 Dec 2001 02:50:01 +0000 Subject: vertex program check-in --- src/mesa/tnl/t_vb_light.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/mesa/tnl/t_vb_light.c') diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index d0f4981cbd..bbf43468c0 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_light.c,v 1.15 2001/07/17 19:39:32 keithw Exp $ */ +/* $Id: t_vb_light.c,v 1.16 2001/12/14 02:51:45 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -168,12 +168,12 @@ static GLboolean run_lighting( GLcontext *ctx, struct gl_pipeline_stage *stage ) /* Make sure we can talk about elements 0..2 in the vector we are * lighting. */ - if (stage->changed_inputs & (VERT_EYE|VERT_OBJ)) { + if (stage->changed_inputs & (VERT_EYE|VERT_OBJ_BIT)) { if (input->size <= 2) { if (input->flags & VEC_NOT_WRITEABLE) { - ASSERT(VB->importable_data & VERT_OBJ); + ASSERT(VB->importable_data & VERT_OBJ_BIT); - VB->import_data( ctx, VERT_OBJ, VEC_NOT_WRITEABLE ); + VB->import_data( ctx, VERT_OBJ_BIT, VEC_NOT_WRITEABLE ); input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr; ASSERT((input->flags & VEC_NOT_WRITEABLE) == 0); @@ -295,19 +295,19 @@ static GLboolean run_init_lighting( GLcontext *ctx, */ static void check_lighting( GLcontext *ctx, struct gl_pipeline_stage *stage ) { - stage->active = ctx->Light.Enabled; + stage->active = ctx->Light.Enabled && !ctx->VertexProgram.Enabled; if (stage->active) { if (stage->privatePtr) stage->run = run_validate_lighting; - stage->inputs = VERT_NORM|VERT_MATERIAL; + stage->inputs = VERT_NORMAL_BIT|VERT_MATERIAL; if (ctx->Light._NeedVertices) stage->inputs |= VERT_EYE; /* effectively, even when lighting in obj */ if (ctx->Light.ColorMaterialEnabled) - stage->inputs |= VERT_RGBA; + stage->inputs |= VERT_COLOR0_BIT; - stage->outputs = VERT_RGBA; + stage->outputs = VERT_COLOR0_BIT; if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - stage->outputs |= VERT_SPEC_RGB; + stage->outputs |= VERT_COLOR1_BIT; } } @@ -334,13 +334,16 @@ static void dtr( struct gl_pipeline_stage *stage ) const struct gl_pipeline_stage _tnl_lighting_stage = { - "lighting", + "lighting", /* name */ _NEW_LIGHT, /* recheck */ _NEW_LIGHT|_NEW_MODELVIEW, /* recalc -- modelview dependency * otherwise not captured by inputs - * (which may be VERT_OBJ) */ - 0,0,0, /* active, inputs, outputs */ - 0,0, /* changed_inputs, private_data */ + * (which may be VERT_OBJ_BIT) */ + GL_FALSE, /* active? */ + 0, /* inputs */ + 0, /* outputs */ + 0, /* changed_inputs */ + NULL, /* private_data */ dtr, /* destroy */ check_lighting, /* check */ run_init_lighting /* run -- initially set to ctr */ -- cgit v1.2.3