intel / DRI2: When available, use DRI2GetBuffersWithFormat
[mesa.git] / src / mesa / state_tracker / st_atom.c
index ff7d388ddecf103fe1ccc29120839fa2699e0972..ca15ce1b474c5165ceb3cd2303ef28af10014d1f 100644 (file)
@@ -64,18 +64,13 @@ static const struct st_tracked_state *atoms[] =
 
 void st_init_atoms( struct st_context *st )
 {
-   st->atoms = _mesa_malloc(sizeof(atoms));
-   st->nr_atoms = sizeof(atoms)/sizeof(*atoms);
-   memcpy(st->atoms, atoms, sizeof(atoms));
+   /* no-op */
 }
 
 
 void st_destroy_atoms( struct st_context *st )
 {
-   if (st->atoms) {
-      _mesa_free(st->atoms);
-      st->atoms = NULL;
-   }
+   /* no-op */
 }
 
 
@@ -153,8 +148,8 @@ void st_validate_state( struct st_context *st )
       memset(&examined, 0, sizeof(examined));
       prev = *state;
 
-      for (i = 0; i < st->nr_atoms; i++) {      
-        const struct st_tracked_state *atom = st->atoms[i];
+      for (i = 0; i < Elements(atoms); i++) {   
+        const struct st_tracked_state *atom = atoms[i];
         struct st_state_flags generated;
         
 //      _mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);
@@ -166,7 +161,7 @@ void st_validate_state( struct st_context *st )
         }
 
         if (check_state(state, &atom->dirty)) {
-           st->atoms[i]->update( st );
+           atoms[i]->update( st );
 //         _mesa_printf("after: %x\n", atom->dirty.mesa);
         }
 
@@ -184,11 +179,9 @@ void st_validate_state( struct st_context *st )
 
    }
    else {
-      const GLuint nr = st->nr_atoms;
-
-      for (i = 0; i < nr; i++) {        
-        if (check_state(state, &st->atoms[i]->dirty))
-           st->atoms[i]->update( st );
+      for (i = 0; i < Elements(atoms); i++) {   
+        if (check_state(state, &atoms[i]->dirty))
+           atoms[i]->update( st );
       }
    }