summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/r128/r128_context.c4
-rw-r--r--src/mesa/drivers/dri/r128/r128_state.c17
-rw-r--r--src/mesa/drivers/dri/r128/r128_tris.c2
3 files changed, 6 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c
index 986be35c9d..7909951f0b 100644
--- a/src/mesa/drivers/dri/r128/r128_context.c
+++ b/src/mesa/drivers/dri/r128/r128_context.c
@@ -68,8 +68,9 @@ int R128_DEBUG = 0;
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
-#define need_GL_EXT_fog_coord
#define need_GL_EXT_blend_minmax
+#define need_GL_EXT_fog_coord
+#define need_GL_EXT_secondary_color
#include "extension_helper.h"
const struct dri_extension card_extensions[] =
@@ -82,6 +83,7 @@ const struct dri_extension card_extensions[] =
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_texture_edge_clamp", NULL },
+ { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_NV_blend_square", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c
index 7da3a08190..f6c6504566 100644
--- a/src/mesa/drivers/dri/r128/r128_state.c
+++ b/src/mesa/drivers/dri/r128/r128_state.c
@@ -545,34 +545,20 @@ static void updateSpecularLighting( GLcontext *ctx )
r128ContextPtr rmesa = R128_CONTEXT(ctx);
GLuint t = rmesa->setup.tex_cntl_c;
- if ( ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR &&
- ctx->Light.Enabled) {
- /* XXX separate specular color just doesn't seem to work as it should.
- * For now, we fall back to s/w rendering whenever separate specular
- * is enabled.
- */
-#if 0
+ if ( NEED_SECONDARY_COLOR( ctx ) ) {
if (ctx->Light.ShadeModel == GL_FLAT) {
/* R128 can't do flat-shaded separate specular */
t &= ~R128_SPEC_LIGHT_ENABLE;
FALLBACK( rmesa, R128_FALLBACK_SEP_SPECULAR, GL_TRUE );
- /*printf("%s fallback sep spec\n", __FUNCTION__);*/
}
else {
t |= R128_SPEC_LIGHT_ENABLE;
FALLBACK( rmesa, R128_FALLBACK_SEP_SPECULAR, GL_FALSE );
- /*printf("%s enable sep spec\n", __FUNCTION__);*/
}
-#else
- t &= ~R128_SPEC_LIGHT_ENABLE;
- FALLBACK( rmesa, R128_FALLBACK_SEP_SPECULAR, GL_TRUE );
- /*printf("%s fallback sep spec\n", __FUNCTION__);*/
-#endif
}
else {
t &= ~R128_SPEC_LIGHT_ENABLE;
FALLBACK( rmesa, R128_FALLBACK_SEP_SPECULAR, GL_FALSE );
- /*printf("%s disable sep spec\n", __FUNCTION__);*/
}
if ( rmesa->setup.tex_cntl_c != t ) {
@@ -855,6 +841,7 @@ static void r128DDEnable( GLcontext *ctx, GLenum cap, GLboolean state )
break;
case GL_LIGHTING:
+ case GL_COLOR_SUM_EXT:
updateSpecularLighting(ctx);
break;
diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c
index c12ad0ccb0..64f54682b6 100644
--- a/src/mesa/drivers/dri/r128/r128_tris.c
+++ b/src/mesa/drivers/dri/r128/r128_tris.c
@@ -595,7 +595,7 @@ static void r128RenderStart( GLcontext *ctx )
#if MESA_LITTLE_ENDIAN
if ( index & _TNL_BIT_COLOR1) {
rmesa->specoffset = offset;
- EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_RGB,
+ EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR,
R128_CCE_VC_FRMT_SPEC_FRGB, 3 );
} else
EMIT_PAD( 3 );