Add the GL_LIGHING enable
authorStephane Marchesin <marchesin@icps.u-strasbg.fr>
Sat, 11 Nov 2006 11:25:08 +0000 (11:25 +0000)
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>
Sat, 11 Nov 2006 11:25:08 +0000 (11:25 +0000)
src/mesa/drivers/dri/nouveau/nouveau_context.h
src/mesa/drivers/dri/nouveau/nv30_state.c

index d1abde68561980b9545981bb86aec7da79aeaad2..257d09f8b28a0b88ab40b7936a4a3013127f8e0e 100644 (file)
@@ -98,6 +98,7 @@ typedef struct nouveau_context {
        uint32_t clear_value;
 
        /* Light state */
+       GLboolean lighting_enabled;
        uint32_t enabled_lights;
 
        /* The drawing fallbacks */
index 71a44085ae82ed5bfaec0e154c191decf14975b8..b1914b462ffcc0af72fec78abedbaaba02ab5eb1 100644 (file)
@@ -230,11 +230,21 @@ void nv30Enable(GLcontext *ctx, GLenum cap, GLboolean state)
                        {
                        uint32_t mask=0x11<<(2*(cap-GL_LIGHT0));
                        nmesa->enabled_lights=((nmesa->enabled_lights&mask)|(mask*state));
-                       BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1);
-                       OUT_RING(nmesa->enabled_lights);
+                       if (nmesa->lighting_enabled)
+                       {
+                               BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1);
+                               OUT_RING(nmesa->enabled_lights);
+                       }
                        break;
                        }
-//             case GL_LIGHTING:
+               case GL_LIGHTING:
+                       nmesa->lighting_enabled=state;
+                       BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_ENABLED_LIGHTS, 1);
+                       if (nmesa->lighting_enabled)
+                               OUT_RING(nmesa->enabled_lights);
+                       else
+                               OUT_RING(0x0);
+                       break;
 //             case GL_LINE_SMOOTH:
 //             case GL_LINE_STIPPLE:
 //             case GL_MAP1_COLOR_4: