fix two-sided lighting / vertex program bug (#887330)
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 4 Feb 2004 03:00:42 +0000 (03:00 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 4 Feb 2004 03:00:42 +0000 (03:00 +0000)
src/mesa/swrast_setup/ss_context.c
src/mesa/swrast_setup/ss_triangle.c

index ef83dd42370146907be15e288005da5c4eeec7fe..cc30d5a93f55afec65cf45ef047c57883bd22fad 100644 (file)
@@ -1,9 +1,8 @@
-
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
+ * Version:  6.0.1
  *
- * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 #include "tnl/t_pipeline.h"
 #include "tnl/t_vertex.h"
 
-#define _SWSETUP_NEW_RENDERINDEX (_NEW_POLYGON|_NEW_LIGHT)
+/* Need to check lighting state and vertex program state to know
+ * if two-sided lighting is in effect.
+ */
+#define _SWSETUP_NEW_RENDERINDEX (_NEW_POLYGON|_NEW_LIGHT|_NEW_PROGRAM)
 
 
 GLboolean
index 3a0af5de5eb6f069dc7c67a11c7f326458867874..39e391261224f2e96a2b3f2ade3e55490a915a1c 100644 (file)
@@ -1,9 +1,8 @@
-
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  6.0.1
  *
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -291,7 +290,8 @@ void _swsetup_choose_trifuncs( GLcontext *ctx )
        ctx->Polygon.OffsetFill)
       ind |= SS_OFFSET_BIT;
 
-   if (ctx->Light.Enabled && ctx->Light.Model.TwoSide)
+   if ((ctx->Light.Enabled && ctx->Light.Model.TwoSide) ||
+       ctx->VertexProgram.TwoSideEnabled)
       ind |= SS_TWOSIDE_BIT;
 
    /* We piggyback the two-sided stencil front/back determination on the