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_draw.c | |
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_draw.c')
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index d12d77f5015..92eb4a39e9b 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -173,7 +173,7 @@ st_draw_vbo(struct gl_context *ctx, st_invalidate_readpix_cache(st); /* Validate state. */ - if (st->dirty.st || st->dirty.mesa || ctx->NewDriverState) { + if ((st->dirty | ctx->NewDriverState) & ST_PIPELINE_RENDER_STATE_MASK) { st_validate_state(st, ST_PIPELINE_RENDER); } @@ -278,7 +278,7 @@ st_indirect_draw_vbo(struct gl_context *ctx, assert(stride); /* Validate state. */ - if (st->dirty.st || st->dirty.mesa || ctx->NewDriverState) { + if ((st->dirty | ctx->NewDriverState) & ST_PIPELINE_RENDER_STATE_MASK) { st_validate_state(st, ST_PIPELINE_RENDER); } |