diff options
author | Stephane Marchesin <marchesin@icps.u-strasbg.fr> | 2006-11-11 11:25:08 +0000 |
---|---|---|
committer | Stephane Marchesin <marchesin@icps.u-strasbg.fr> | 2006-11-11 11:25:08 +0000 |
commit | 0850289d8c66f75ac72347b1bf4bf6d15fb60139 (patch) | |
tree | 59a994e365f567148176e6ae656490753dc6e8de /src/mesa | |
parent | f82bc9110b3b06f3313e584e860d0e41d11965f0 (diff) |
Add the GL_LIGHING enable
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_context.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv30_state.c | 16 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index d1abde6856..257d09f8b2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -98,6 +98,7 @@ typedef struct nouveau_context { uint32_t clear_value; /* Light state */ + GLboolean lighting_enabled; uint32_t enabled_lights; /* The drawing fallbacks */ diff --git a/src/mesa/drivers/dri/nouveau/nv30_state.c b/src/mesa/drivers/dri/nouveau/nv30_state.c index 71a44085ae..b1914b462f 100644 --- a/src/mesa/drivers/dri/nouveau/nv30_state.c +++ b/src/mesa/drivers/dri/nouveau/nv30_state.c @@ -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: |