r600: Add support for GL_EXT_provoking_vertex
authorAlex Deucher <alexdeucher@gmail.com>
Fri, 4 Sep 2009 22:08:31 +0000 (18:08 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Fri, 4 Sep 2009 22:46:15 +0000 (18:46 -0400)
src/mesa/drivers/dri/r600/r600_context.c
src/mesa/drivers/dri/r600/r700_state.c

index 251c124cbf4ade799849be51e4da3512a3852aaf..7a5bcd9ac23676ff0509063471320163e5b6bac9 100644 (file)
@@ -85,6 +85,7 @@ int hw_tcl_on = 1;
 #define need_GL_EXT_framebuffer_object
 #define need_GL_EXT_fog_coord
 #define need_GL_EXT_gpu_program_parameters
+#define need_GL_EXT_provoking_vertex
 #define need_GL_EXT_secondary_color
 #define need_GL_EXT_stencil_two_side
 #define need_GL_ATI_separate_stencil
@@ -117,6 +118,7 @@ const struct dri_extension card_extensions[] = {
   {"GL_EXT_packed_depth_stencil",      NULL},
   {"GL_EXT_fog_coord",                 GL_EXT_fog_coord_functions },
   {"GL_EXT_gpu_program_parameters",     GL_EXT_gpu_program_parameters_functions},
+  {"GL_EXT_provoking_vertex",           GL_EXT_provoking_vertex_functions },
   {"GL_EXT_secondary_color",           GL_EXT_secondary_color_functions},
   {"GL_EXT_shadow_funcs",              NULL},
   {"GL_EXT_stencil_two_side",          GL_EXT_stencil_two_side_functions},
index 1f4724e8384f7347ca61cb8767517d59d746fbcf..93b4ebfdb96d1f057ec57f27e103d9f7076f8a24 100644 (file)
@@ -171,6 +171,14 @@ static void r700InvalidateState(GLcontext * ctx, GLuint new_state) //-----------
            R600_STATECHANGE(context, db_target);
     }
 
+    if (new_state & (_NEW_LIGHT)) {
+           R600_STATECHANGE(context, su);
+           if (ctx->Light.ProvokingVertex == GL_LAST_VERTEX_CONVENTION)
+                   SETbit(r700->PA_SU_SC_MODE_CNTL.u32All, PROVOKING_VTX_LAST_bit);
+           else
+                   CLEARbit(r700->PA_SU_SC_MODE_CNTL.u32All, PROVOKING_VTX_LAST_bit);
+    }
+
     r700UpdateStateParameters(ctx, new_state);
 
     R600_STATECHANGE(context, cl);