summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-12-18 16:00:20 -0700
committerBrian Paul <brian.paul@tungstengraphics.com>2008-12-18 16:00:20 -0700
commit52406c80d67d3e101d1da0f5babaabac202d31d5 (patch)
tree45a922b08adc375eca98e863687527b5cac60974 /src/mesa/state_tracker
parenta795e79f87909f687dba9ddd09c5bc46cc6e9228 (diff)
gallium: fix two-sided lighting test in state tracker
This fixes two-sided lighting for vertex shaders.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 5eef4ebe92..ea76487bcf 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -107,12 +107,15 @@ static void update_raster_state( struct st_context *st )
/* _NEW_LIGHT | _NEW_PROGRAM
*
* Back-face colors can come from traditional lighting (when
- * GL_LIGHT_MODEL_TWO_SIDE is set) or from vertex programs (when
+ * GL_LIGHT_MODEL_TWO_SIDE is set) or from vertex programs/shaders (when
* GL_VERTEX_PROGRAM_TWO_SIDE is set). Note the logic here.
*/
if (ctx->VertexProgram._Current) {
- if (ctx->VertexProgram._Enabled) {
- /* user-defined program */
+ if (ctx->VertexProgram._Enabled ||
+ (ctx->Shader.CurrentProgram &&
+ ctx->Shader.CurrentProgram->VertexProgram &&
+ ctx->Shader.CurrentProgram->LinkStatus)) {
+ /* user-defined vertex program or shader */
raster->light_twoside = ctx->VertexProgram.TwoSideEnabled;
}
else {