st/mesa: completely rewrite state atoms
authorMarek Olšák <marek.olsak@amd.com>
Sun, 17 Jul 2016 16:38:38 +0000 (18:38 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 30 Jul 2016 13:02:14 +0000 (15:02 +0200)
commitc8fe3b9dca73e3b91979d92ba4136b302001b3bb
treefcef8db3a9b400b2ed249772f688497d5e069771
parent53bc28920a8524d7bc795c3ce6398dc34a8e2152
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>
33 files changed:
src/mesa/Makefile.sources
src/mesa/state_tracker/st_atom.c
src/mesa/state_tracker/st_atom.h
src/mesa/state_tracker/st_atom_array.c
src/mesa/state_tracker/st_atom_atomicbuf.c
src/mesa/state_tracker/st_atom_blend.c
src/mesa/state_tracker/st_atom_clip.c
src/mesa/state_tracker/st_atom_constbuf.c
src/mesa/state_tracker/st_atom_depth.c
src/mesa/state_tracker/st_atom_framebuffer.c
src/mesa/state_tracker/st_atom_image.c
src/mesa/state_tracker/st_atom_list.h [new file with mode: 0644]
src/mesa/state_tracker/st_atom_msaa.c
src/mesa/state_tracker/st_atom_pixeltransfer.c
src/mesa/state_tracker/st_atom_rasterizer.c
src/mesa/state_tracker/st_atom_sampler.c
src/mesa/state_tracker/st_atom_scissor.c
src/mesa/state_tracker/st_atom_shader.c
src/mesa/state_tracker/st_atom_stipple.c
src/mesa/state_tracker/st_atom_storagebuf.c
src/mesa/state_tracker/st_atom_tess.c
src/mesa/state_tracker/st_atom_texture.c
src/mesa/state_tracker/st_atom_viewport.c
src/mesa/state_tracker/st_cb_bitmap.c
src/mesa/state_tracker/st_cb_bufferobjects.c
src/mesa/state_tracker/st_cb_compute.c
src/mesa/state_tracker/st_cb_feedback.c
src/mesa/state_tracker/st_cb_program.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_manager.c