Use NEED_SECONDARY_COLOR() for checking specular state at all times

when ctx->_TriangleCaps might be inaccurate (ie while ctx->NewState might
be non-zero).
This commit is contained in:
Keith Whitwell
2004-01-28 08:21:05 +00:00
parent c78a89d761
commit 43b5772834
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -979,7 +979,7 @@ static void update_specular( GLcontext *ctx )
I830_STATECHANGE(imesa, I830_UPLOAD_CTX);
imesa->Setup[I830_CTXREG_ENABLES_1] &= ~ENABLE_SPEC_ADD_MASK;
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)
if (NEED_SECONDARY_COLOR(ctx))
imesa->Setup[I830_CTXREG_ENABLES_1] |= ENABLE_SPEC_ADD;
else
imesa->Setup[I830_CTXREG_ENABLES_1] |= DISABLE_SPEC_ADD;
+1 -1
View File
@@ -483,7 +483,7 @@ static void updateSpecularLighting( GLcontext *ctx )
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
unsigned int specen;
specen = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TMC_specen_enable : 0;
specen = NEED_SECONDARY_COLOR(ctx) ? TMC_specen_enable : 0;
if ( specen != mmesa->hw.specen ) {
mmesa->hw.specen = specen;
@@ -550,7 +550,7 @@ void radeonUpdateSpecular( GLcontext *ctx )
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLuint p = rmesa->hw.ctx.cmd[CTX_PP_CNTL];
if ( ctx->_TriangleCaps & DD_SEPARATE_SPECULAR ) {
if (NEED_SECONDARY_COLOR(ctx)) {
p |= RADEON_SPECULAR_ENABLE;
} else {
p &= ~RADEON_SPECULAR_ENABLE;
+1 -1
View File
@@ -738,7 +738,7 @@ static void radeonUpdateSpecular( GLcontext *ctx )
rmesa->hw.tcl.cmd[TCL_LIGHT_MODEL_CTL] |= RADEON_LIGHTING_ENABLE;
}
if ( ctx->_TriangleCaps & DD_SEPARATE_SPECULAR ) {
if (NEED_SECONDARY_COLOR(ctx)) {
assert( (p & RADEON_SPECULAR_ENABLE) != 0 );
} else {
assert( (p & RADEON_SPECULAR_ENABLE) == 0 );