From: Brian Date: Wed, 16 Jan 2008 15:30:00 +0000 (-0700) Subject: Fix a two-sided lighting bug (fixes samples/wave.c) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd235ff1db6a2839607931cc07f9ba6e602ac3d4;p=mesa.git Fix a two-sided lighting bug (fixes samples/wave.c) --- diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index 35fd5064581..beae36bca00 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -110,7 +110,14 @@ static void update_raster_state( struct st_context *st ) * GL_VERTEX_PROGRAM_TWO_SIDE is set). Note the logic here. */ if (ctx->VertexProgram._Current) { - raster.light_twoside = ctx->VertexProgram.TwoSideEnabled; + if (ctx->VertexProgram._Enabled) { + /* user-defined program */ + raster.light_twoside = ctx->VertexProgram.TwoSideEnabled; + } + else { + /* TNL-generated program */ + raster.light_twoside = ctx->Light.Enabled && ctx->Light.Model.TwoSide; + } } else if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) { raster.light_twoside = 1;