mesa: Fix detection of whether an ARB_vp is enabled for two sided lighting.
authorEric Anholt <eric@anholt.net>
Tue, 18 Oct 2011 22:20:27 +0000 (15:20 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 20 Oct 2011 15:45:20 +0000 (08:45 -0700)
When there is no ARB_vertex_program program enabled, the Current
pointer points at a default program, so we were always using
VERTEX_PROGRAM_TWO_SIDE, even for fixed function lighting.

Fixes piglit two-sided-lighting*

Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/state.c

index 98ca733c0b9becb19a86ad4cbc2681c83cbe1cbe..80fd03b919d8ac40f3a7a76499a61725feebd0aa 100644 (file)
@@ -461,7 +461,7 @@ static void
 update_twoside(struct gl_context *ctx)
 {
    if (ctx->Shader.CurrentVertexProgram ||
-       ctx->VertexProgram.Current) {
+       ctx->VertexProgram._Enabled) {
       ctx->VertexProgram._TwoSideEnabled = ctx->VertexProgram.TwoSideEnabled;
    } else {
       ctx->VertexProgram._TwoSideEnabled = (ctx->Light.Enabled &&