summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-01-16 08:30:00 -0700
committerBrian <[email protected]>2008-01-16 08:30:00 -0700
commitdd235ff1db6a2839607931cc07f9ba6e602ac3d4 (patch)
treeba2ff77b719860f05524eb0b79f63680659bee3f /src
parent587e2becc237bc1c900a1c0ba114a1a0192690ff (diff)
Fix a two-sided lighting bug (fixes samples/wave.c)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c9
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 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;