summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-04-30 00:42:16 +0200
committerMarek Olšák <[email protected]>2017-05-08 18:32:00 +0200
commitd1ee2b37ffb5c4f8365592d7c548ccf50bd0f10a (patch)
tree37dbb26ffeac3c3de85ec49a5c9694359a3342d3 /src/mesa/state_tracker/st_atom.c
parentcb2ac69628a89a601ff682fdc3bc3c8ee5e306b3 (diff)
st/mesa: remove struct st_tracked_state
It contains only one member: the update function. Let's use the update function directly. Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_atom.c')
-rw-r--r--src/mesa/state_tracker/st_atom.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
index abbbd4d45a3..b40ce1e3399 100644
--- a/src/mesa/state_tracker/st_atom.c
+++ b/src/mesa/state_tracker/st_atom.c
@@ -36,11 +36,12 @@
#include "st_program.h"
#include "st_manager.h"
+typedef void (*update_func_t)(struct st_context *st);
/* The list state update functions. */
-static const struct st_tracked_state *atoms[] =
+static const update_func_t update_functions[] =
{
-#define ST_STATE(FLAG, st_update) &st_update,
+#define ST_STATE(FLAG, st_update) st_update,
#include "st_atom_list.h"
#undef ST_STATE
};
@@ -48,7 +49,7 @@ static const struct st_tracked_state *atoms[] =
void st_init_atoms( struct st_context *st )
{
- STATIC_ASSERT(ARRAY_SIZE(atoms) <= 64);
+ STATIC_ASSERT(ARRAY_SIZE(update_functions) <= 64);
}
@@ -226,9 +227,9 @@ void st_validate_state( struct st_context *st, enum st_pipeline pipeline )
* Don't use u_bit_scan64, it may be slower on 32-bit.
*/
while (dirty_lo)
- atoms[u_bit_scan(&dirty_lo)]->update(st);
+ update_functions[u_bit_scan(&dirty_lo)](st);
while (dirty_hi)
- atoms[32 + u_bit_scan(&dirty_hi)]->update(st);
+ update_functions[32 + u_bit_scan(&dirty_hi)](st);
/* Clear the render or compute state bits. */
st->dirty &= ~pipeline_mask;