summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/sis/sis_state.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2005-10-24 21:30:06 +0000
committerEric Anholt <anholt@FreeBSD.org>2005-10-24 21:30:06 +0000
commit81d3bf58ff2b143b7df16e5d7af8672b33626e40 (patch)
tree0814f998c98578d8683467126620817ce1f25ce3 /src/mesa/drivers/dri/sis/sis_state.c
parent310f1551b45b190b52ee4c7a7a2beda4becfcf3f (diff)
Add support for GL_EXT_secondary_color, tested with seccolor test.
Diffstat (limited to 'src/mesa/drivers/dri/sis/sis_state.c')
-rw-r--r--src/mesa/drivers/dri/sis/sis_state.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_state.c b/src/mesa/drivers/dri/sis/sis_state.c
index 01688c2fda..195a624b40 100644
--- a/src/mesa/drivers/dri/sis/sis_state.c
+++ b/src/mesa/drivers/dri/sis/sis_state.c
@@ -400,6 +400,25 @@ static void sisDDColorMask( GLcontext *ctx,
* Rendering attributes
*/
+static void sisUpdateSpecular(GLcontext *ctx)
+{
+ sisContextPtr smesa = SIS_CONTEXT(ctx);
+ __GLSiSHardware *current = &smesa->current;
+
+ if (NEED_SECONDARY_COLOR(ctx))
+ current->hwCapEnable |= MASK_SpecularEnable;
+ else
+ current->hwCapEnable &= ~MASK_SpecularEnable;
+}
+
+static void sisDDLightModelfv(GLcontext *ctx, GLenum pname,
+ const GLfloat *param)
+{
+ if (pname == GL_LIGHT_MODEL_COLOR_CONTROL) {
+ sisUpdateSpecular(ctx);
+ }
+}
+
static void sisDDShadeModel( GLcontext *ctx, GLenum mode )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
@@ -636,7 +655,11 @@ sisDDEnable( GLcontext * ctx, GLenum cap, GLboolean state )
MASK_StencilWriteEnable);
}
break;
- }
+ case GL_LIGHTING:
+ case GL_COLOR_SUM_EXT:
+ sisUpdateSpecular(ctx);
+ break;
+ }
}
@@ -694,7 +717,6 @@ void sisDDInitState( sisContextPtr smesa )
/* add Texture Perspective Enable */
prev->hwCapEnable = MASK_FogPerspectiveEnable | MASK_TextureCacheEnable |
MASK_TexturePerspectiveEnable | MASK_DitherEnable;
- /*| MASK_SpecularEnable*/
/*
prev->hwCapEnable2 = 0x00aa0080;
@@ -829,6 +851,7 @@ void sisDDInitStateFuncs( GLcontext *ctx )
ctx->Driver.RenderMode = NULL;
ctx->Driver.Scissor = sisDDScissor;
ctx->Driver.ShadeModel = sisDDShadeModel;
+ ctx->Driver.LightModelfv = sisDDLightModelfv;
ctx->Driver.Viewport = sisDDViewport;
/* Pixel path fallbacks. */