From c8fe3b9dca73e3b91979d92ba4136b302001b3bb Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 17 Jul 2016 18:38:38 +0200 Subject: st/mesa: completely rewrite state atoms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/mesa/state_tracker/st_manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/state_tracker/st_manager.c') diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index d323c87de7d..e2da054d2a5 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -153,7 +153,7 @@ st_context_validate(struct st_context *st, struct st_framebuffer *stread) { if (stdraw && stdraw->stamp != st->draw_stamp) { - st->dirty.st |= ST_NEW_FRAMEBUFFER; + st->dirty |= ST_NEW_FRAMEBUFFER; _mesa_resize_framebuffer(st->ctx, &stdraw->Base, stdraw->Base.Width, stdraw->Base.Height); @@ -162,7 +162,7 @@ st_context_validate(struct st_context *st, if (stread && stread->stamp != st->read_stamp) { if (stread != stdraw) { - st->dirty.st |= ST_NEW_FRAMEBUFFER; + st->dirty |= ST_NEW_FRAMEBUFFER; _mesa_resize_framebuffer(st->ctx, &stread->Base, stread->Base.Width, stread->Base.Height); -- cgit v1.2.3