diff options
author | Marek Olšák <[email protected]> | 2016-07-17 18:38:38 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-07-30 15:02:14 +0200 |
commit | c8fe3b9dca73e3b91979d92ba4136b302001b3bb (patch) | |
tree | fcef8db3a9b400b2ed249772f688497d5e069771 /src/mesa/state_tracker/st_context.h | |
parent | 53bc28920a8524d7bc795c3ce6398dc34a8e2152 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_context.h')
-rw-r--r-- | src/mesa/state_tracker/st_context.h | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index b3cf285984f..b9ad2a92433 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -32,6 +32,7 @@ #include "pipe/p_state.h" #include "state_tracker/st_api.h" #include "main/fbobject.h" +#include "state_tracker/st_atom.h" #ifdef __cplusplus @@ -50,44 +51,6 @@ struct st_perf_monitor_group; struct u_upload_mgr; -/* gap */ -#define ST_NEW_FRAGMENT_PROGRAM (1 << 1) -#define ST_NEW_VERTEX_PROGRAM (1 << 2) -#define ST_NEW_FRAMEBUFFER (1 << 3) -#define ST_NEW_TESS_STATE (1 << 4) -#define ST_NEW_GEOMETRY_PROGRAM (1 << 5) -#define ST_NEW_VERTEX_ARRAYS (1 << 6) -#define ST_NEW_RASTERIZER (1 << 7) -#define ST_NEW_UNIFORM_BUFFER (1 << 8) -#define ST_NEW_TESSCTRL_PROGRAM (1 << 9) -#define ST_NEW_TESSEVAL_PROGRAM (1 << 10) -#define ST_NEW_SAMPLER_VIEWS (1 << 11) -#define ST_NEW_ATOMIC_BUFFER (1 << 12) -#define ST_NEW_STORAGE_BUFFER (1 << 13) -#define ST_NEW_COMPUTE_PROGRAM (1 << 14) -#define ST_NEW_IMAGE_UNITS (1 << 15) - - -struct st_state_flags { - GLbitfield mesa; /**< Mask of _NEW_x flags */ - uint32_t st; /**< Mask of ST_NEW_x flags */ -}; - -struct st_tracked_state { - struct st_state_flags dirty; - void (*update)( struct st_context *st ); -}; - - -/** - * Enumeration of state tracker pipelines. - */ -enum st_pipeline { - ST_PIPELINE_RENDER, - ST_PIPELINE_COMPUTE, -}; - - /** For drawing quads for glClear, glDraw/CopyPixels, glBitmap, etc. */ struct st_util_vertex { @@ -175,8 +138,7 @@ struct st_context char vendor[100]; char renderer[100]; - struct st_state_flags dirty; - struct st_state_flags dirty_cp; + uint64_t dirty; /**< dirty states */ GLboolean vertdata_edgeflags; GLboolean edgeflag_culls_prims; |