summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-07-13 14:28:15 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-07-13 14:28:15 -0600
commitf0636d9653d142bdf71475d2d2066f5c7c436978 (patch)
tree78c0f2dd69c9beb241638bc1fbedfb847a34d519 /src/mesa
parenta2e471e05e452454f78db7a5fbc6845f6ca39f35 (diff)
Fix setup.light_twoside determination.
When a vertex program is used, use value of GL_VERTEX_PROGRAM_TWO_SIDE. Otherwise, if FF lighting, use value of GL_LIGHT_MODEL_TWO_SIDE.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_atom_setup.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_atom_setup.c b/src/mesa/state_tracker/st_atom_setup.c
index 08f7a8a732..6ee96f6178 100644
--- a/src/mesa/state_tracker/st_atom_setup.c
+++ b/src/mesa/state_tracker/st_atom_setup.c
@@ -98,14 +98,18 @@ static void update_setup_state( struct st_context *st )
if (ctx->Light.ShadeModel == GL_FLAT)
setup.flatshade = 1;
- /* _NEW_LIGHT
+ /* _NEW_LIGHT | _NEW_PROGRAM
*
- * Not sure about the light->enabled requirement - does this still
- * apply??
+ * Back-face colors can come from traditional lighting (when
+ * GL_LIGHT_MODEL_TWO_SIDE is set) or from vertex programs (when
+ * GL_VERTEX_PROGRAM_TWO_SIDE is set). Note the logic here.
*/
- if (ctx->Light.Enabled &&
- ctx->Light.Model.TwoSide)
+ if (ctx->VertexProgram._Enabled) {
+ setup.light_twoside = ctx->VertexProgram.TwoSideEnabled;
+ }
+ else if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) {
setup.light_twoside = 1;
+ }
/* _NEW_POLYGON
*/