diff options
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: |