diff options
author | Brian <brian.paul@tungstengraphics.com> | 2008-01-16 08:30:00 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2008-01-16 08:30:00 -0700 |
commit | dd235ff1db6a2839607931cc07f9ba6e602ac3d4 (patch) | |
tree | ba2ff77b719860f05524eb0b79f63680659bee3f /src/mesa/state_tracker/st_atom_rasterizer.c | |
parent | 587e2becc237bc1c900a1c0ba114a1a0192690ff (diff) |
Fix a two-sided lighting bug (fixes samples/wave.c)
Diffstat (limited to 'src/mesa/state_tracker/st_atom_rasterizer.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom_rasterizer.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index 35fd506458..beae36bca0 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; |