dri/nv04: GL_EXT_secondary_color
authorAndrew Randrianasulu <randrik@mail.ru>
Sun, 7 Mar 2010 01:09:21 +0000 (01:09 +0000)
committerFrancisco Jerez <currojerez@riseup.net>
Sun, 7 Mar 2010 21:40:10 +0000 (22:40 +0100)
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/nouveau/nv04_state_raster.c

index e26ed36529a9e12691532aa55dbfa280ce34dd86..502e01255cbbb695154c6c361af9c8be984adce2 100644 (file)
 
 #define need_GL_EXT_framebuffer_object
 #define need_GL_EXT_fog_coord
+#define need_GL_EXT_secondary_color
 
 #include "main/remap_helper.h"
 
 static const struct dri_extension nouveau_extensions[] = {
        { "GL_ARB_multitexture",        NULL },
+       { "GL_ARB_texture_env_add",     NULL },
        { "GL_ARB_texture_env_combine", NULL },
        { "GL_ARB_texture_env_dot3",    NULL },
-       { "GL_ARB_texture_env_add",     NULL },
-       { "GL_EXT_texture_lod_bias",    NULL },
-       { "GL_EXT_framebuffer_object",  GL_EXT_framebuffer_object_functions },
        { "GL_ARB_texture_mirrored_repeat", NULL },
-       { "GL_EXT_stencil_wrap",        NULL },
        { "GL_EXT_fog_coord",           GL_EXT_fog_coord_functions },
+       { "GL_EXT_framebuffer_object",  GL_EXT_framebuffer_object_functions },
+       { "GL_EXT_secondary_color",     GL_EXT_secondary_color_functions },
+       { "GL_EXT_stencil_wrap",        NULL },
+       { "GL_EXT_texture_lod_bias",    NULL },
        { "GL_NV_blend_square",         NULL },
        { "GL_SGIS_generate_mipmap",    NULL },
        { NULL,                         NULL }
index 4314fc33cf493979efc228e6c68fbba95f9cf552..c191571a5f81ea020dc91d97fdfb05f5a9a21c9b 100644 (file)
@@ -275,6 +275,10 @@ nv04_emit_blend(GLcontext *ctx, int emit)
                else
                        blend |= NV04_MULTITEX_TRIANGLE_BLEND_SHADE_MODE_FLAT;
 
+               /* Secondary color */
+               if (NEED_SECONDARY_COLOR(ctx))
+                       blend |= NV04_MULTITEX_TRIANGLE_BLEND_SPECULAR_ENABLE;
+
                /* Fog. */
                if (ctx->Fog.Enabled)
                        blend |= NV04_MULTITEX_TRIANGLE_BLEND_FOG_ENABLE;
@@ -309,6 +313,10 @@ nv04_emit_blend(GLcontext *ctx, int emit)
                else
                        blend |= get_texenv_mode(GL_MODULATE);
 
+               /* Secondary color */
+               if (NEED_SECONDARY_COLOR(ctx))
+                       blend |= NV04_TEXTURED_TRIANGLE_BLEND_SPECULAR_ENABLE;
+
                /* Fog. */
                if (ctx->Fog.Enabled)
                        blend |= NV04_TEXTURED_TRIANGLE_BLEND_FOG_ENABLE;