mesa/formats: add more MESA_FORMAT_LAYOUTs
[mesa.git] / src / mesa / state_tracker / st_atom.c
index 00149f8ab7790678f5dd9601abb9a86b88d9341f..43dbadd4a7e65b048f3547b3a6fcfacafad462c4 100644 (file)
@@ -26,6 +26,7 @@
  **************************************************************************/
 
 
+#include <stdio.h>
 #include "main/glheader.h"
 #include "main/context.h"
 
@@ -45,9 +46,10 @@ static const struct st_tracked_state *atoms[] =
    &st_update_depth_stencil_alpha,
    &st_update_clip,
 
-   &st_finalize_textures,
    &st_update_fp,
    &st_update_gp,
+   &st_update_tep,
+   &st_update_tcp,
    &st_update_vp,
 
    &st_update_rasterizer,
@@ -58,16 +60,24 @@ static const struct st_tracked_state *atoms[] =
    &st_update_vertex_texture,
    &st_update_fragment_texture,
    &st_update_geometry_texture,
+   &st_update_tessctrl_texture,
+   &st_update_tesseval_texture,
    &st_update_sampler, /* depends on update_*_texture for swizzle */
    &st_update_framebuffer,
    &st_update_msaa,
+   &st_update_sample_shading,
    &st_update_vs_constants,
+   &st_update_tcs_constants,
+   &st_update_tes_constants,
    &st_update_gs_constants,
    &st_update_fs_constants,
    &st_bind_vs_ubos,
+   &st_bind_tcs_ubos,
+   &st_bind_tes_ubos,
    &st_bind_fs_ubos,
    &st_bind_gs_ubos,
    &st_update_pixel_transfer,
+   &st_update_tess,
 
    /* this must be done after the vertex program update */
    &st_update_array
@@ -132,18 +142,22 @@ static void check_program_state( struct st_context *st )
 static void check_attrib_edgeflag(struct st_context *st)
 {
    const struct gl_client_array **arrays = st->ctx->Array._DrawArrays;
-   GLboolean vertdata_edgeflags, edgeflag_culls_prims;
+   GLboolean vertdata_edgeflags, edgeflag_culls_prims, edgeflags_enabled;
 
    if (!arrays)
       return;
 
-   vertdata_edgeflags = arrays[VERT_ATTRIB_EDGEFLAG]->StrideB != 0;
+   edgeflags_enabled = st->ctx->Polygon.FrontMode != GL_FILL ||
+                       st->ctx->Polygon.BackMode != GL_FILL;
+
+   vertdata_edgeflags = edgeflags_enabled &&
+                        arrays[VERT_ATTRIB_EDGEFLAG]->StrideB != 0;
    if (vertdata_edgeflags != st->vertdata_edgeflags) {
       st->vertdata_edgeflags = vertdata_edgeflags;
-      st->dirty.st |= ST_NEW_EDGEFLAGS_DATA;
+      st->dirty.st |= ST_NEW_VERTEX_PROGRAM;
    }
 
-   edgeflag_culls_prims = !vertdata_edgeflags &&
+   edgeflag_culls_prims = edgeflags_enabled && !vertdata_edgeflags &&
                           !st->ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0];
    if (edgeflag_culls_prims != st->edgeflag_culls_prims) {
       st->edgeflag_culls_prims = edgeflag_culls_prims;
@@ -177,7 +191,7 @@ void st_validate_state( struct st_context *st )
    if (state->st == 0)
       return;
 
-   /*printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/
+   /*printf("%s %x/%x\n", __func__, state->mesa, state->st);*/
 
 #ifdef DEBUG
    if (1) {
@@ -192,7 +206,7 @@ void st_validate_state( struct st_context *st )
       memset(&examined, 0, sizeof(examined));
       prev = *state;
 
-      for (i = 0; i < Elements(atoms); i++) {   
+      for (i = 0; i < ARRAY_SIZE(atoms); i++) {         
         const struct st_tracked_state *atom = atoms[i];
         struct st_state_flags generated;
         
@@ -223,7 +237,7 @@ void st_validate_state( struct st_context *st )
 
    }
    else {
-      for (i = 0; i < Elements(atoms); i++) {   
+      for (i = 0; i < ARRAY_SIZE(atoms); i++) {         
         if (check_state(state, &atoms[i]->dirty))
            atoms[i]->update( st );
       }