st/mesa: completely rewrite state atoms

The goal is to do this in st_validate_state:
   while (dirty)
      atoms[u_bit_scan(&dirty)]->update(st);

That implies that atoms can't specify which flags they consume.
There is exactly one ST_NEW_* flag for each atom. (58 flags in total)

There are macros that combine multiple flags into one for easier use.

All _NEW_* flags are translated into ST_NEW_* flags in st_invalidate_state.
st/mesa doesn't keep the _NEW_* flags after that.

torcs is 2% faster between the previous patch and the end of this series.

v2: - add st_atom_list.h to Makefile.sources

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák
2016-07-17 18:38:38 +02:00
parent 53bc28920a
commit c8fe3b9dca
33 changed files with 383 additions and 518 deletions

View File

@@ -86,17 +86,9 @@ static void update_sample_shading( struct st_context *st )
}
const struct st_tracked_state st_update_msaa = {
{ /* dirty */
(_NEW_MULTISAMPLE | _NEW_BUFFERS), /* mesa */
ST_NEW_FRAMEBUFFER, /* st */
},
update_sample_mask /* update */
};
const struct st_tracked_state st_update_sample_shading = {
{ /* dirty */
(_NEW_MULTISAMPLE | _NEW_PROGRAM | _NEW_BUFFERS), /* mesa */
ST_NEW_FRAGMENT_PROGRAM | ST_NEW_FRAMEBUFFER, /* st */
},
update_sample_shading /* update */
};