Re: [Mesa-dev] [PATCH 3/9] st/mesa: completely rewrite state atoms
On Mon, Jul 25, 2016 at 1:19 PM, Marek Olšákwrote: > On Mon, Jul 25, 2016 at 5:42 PM, Rob Clark wrote: >> On Mon, Jul 25, 2016 at 11:16 AM, Brian Paul wrote: >>> On 07/18/2016 07:11 AM, Marek Olšák wrote: @@ -183,49 +107,42 @@ static void check_attrib_edgeflag(struct st_context *st) void st_validate_state( struct st_context *st, enum st_pipeline pipeline ) { - const struct st_tracked_state **atoms; - struct st_state_flags *state; - GLuint num_atoms; - GLuint i; + uint64_t dirty, pipeline_mask; + uint32_t dirty_lo, dirty_hi; + + /* Get Mesa driver state. */ + st->dirty |= st->ctx->NewDriverState & ST_ALL_STATES_MASK; + st->ctx->NewDriverState = 0; /* Get pipeline state. */ switch (pipeline) { -case ST_PIPELINE_RENDER: - atoms = render_atoms; - num_atoms = ARRAY_SIZE(render_atoms); - state = >dirty; + case ST_PIPELINE_RENDER: + check_attrib_edgeflag(st); + check_program_state(st); + st_manager_validate_framebuffers(st); + + pipeline_mask = ST_PIPELINE_RENDER_STATE_MASK; break; case ST_PIPELINE_COMPUTE: - atoms = compute_atoms; - num_atoms = ARRAY_SIZE(compute_atoms); - state = >dirty_cp; + pipeline_mask = ST_PIPELINE_COMPUTE_STATE_MASK; break; default: unreachable("Invalid pipeline specified"); } - /* Get Mesa driver state. */ - st->dirty.st |= st->ctx->NewDriverState; - st->dirty_cp.st |= st->ctx->NewDriverState; - st->ctx->NewDriverState = 0; - - if (pipeline == ST_PIPELINE_RENDER) { - check_attrib_edgeflag(st); - - check_program_state(st); - - st_manager_validate_framebuffers(st); - } - - if (state->st == 0 && state->mesa == 0) + dirty = st->dirty & pipeline_mask; + if (!dirty) return; - /*printf("%s %x/%x\n", __func__, state->mesa, state->st);*/ + dirty_lo = dirty; + dirty_hi = dirty >> 32; - for (i = 0; i < num_atoms; i++) { - if (check_state(state, [i]->dirty)) - atoms[i]->update( st ); - } + /* Update states. */ + while (dirty_lo) + atoms[u_bit_scan(_lo)]->update(st); + while (dirty_hi) + atoms[32 + u_bit_scan(_hi)]->update(st); >>> >>> Could we just use the u_bit_scan64() function and void the hi/lo split? >> >> fwiw, we actually did discuss that on irc, but I guess no one >> summarized on email thread.. >> >> Marek's concern was that would generate worse code on 32b since it >> would pull the right-shift into the loop. >> >> I'm not entirely sure if gcc would be clever enough in this case or >> not. I guess someone needs to compare generated asm in both cases. >> And either use u_bit_scan64() if the compiler is clever enough, or add >> a comment explaining the reason. > > Yeah, I added this comment before the loops: > "Don't use u_bit_scan64, it may be slower on 32-bit." > > On 32-bit, ffsll is an if-then-else expression with some arithmetic > and shifting one bit to the left is another if-then-else expression. fwiw, I did spend a bit of time this evening playing around with this, and the dirty_hi/dirty_lo approach w/ 32b/i686 build works out to be something like 12 instructions shorter for the loop body, ie. gcc isn't clever enough (total instruction count increases by doubling the loops but I think that doesn't matter).. given that this is a hot spot in profiles that I've looked at, it might even be worth having some #ifdef 64b / #else.. but ofc that could be left as a future exercise if someone cares.. either way, r-b BR, -R ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/9] st/mesa: completely rewrite state atoms
On Mon, Jul 25, 2016 at 5:42 PM, Rob Clarkwrote: > On Mon, Jul 25, 2016 at 11:16 AM, Brian Paul wrote: >> On 07/18/2016 07:11 AM, Marek Olšák wrote: >>> >>> From: Marek Olšák >>> >>> The goal is to do this in st_validate_state: >>> while (dirty) >>>atoms[u_bit_scan()]->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. >>> --- >>> src/mesa/state_tracker/st_atom.c | 153 +- >>> src/mesa/state_tracker/st_atom.h | 210 >>> + >>> src/mesa/state_tracker/st_atom_array.c | 4 - >>> src/mesa/state_tracker/st_atom_atomicbuf.c | 24 --- >>> src/mesa/state_tracker/st_atom_blend.c | 4 - >>> src/mesa/state_tracker/st_atom_clip.c | 4 - >>> src/mesa/state_tracker/st_atom_constbuf.c | 48 -- >>> src/mesa/state_tracker/st_atom_depth.c | 4 - >>> src/mesa/state_tracker/st_atom_framebuffer.c | 4 - >>> src/mesa/state_tracker/st_atom_image.c | 24 --- >>> src/mesa/state_tracker/st_atom_list.h | 75 + >>> src/mesa/state_tracker/st_atom_msaa.c | 8 - >>> src/mesa/state_tracker/st_atom_pixeltransfer.c | 4 - >>> src/mesa/state_tracker/st_atom_rasterizer.c| 16 -- >>> src/mesa/state_tracker/st_atom_sampler.c | 4 - >>> src/mesa/state_tracker/st_atom_scissor.c | 8 - >>> src/mesa/state_tracker/st_atom_shader.c| 24 --- >>> src/mesa/state_tracker/st_atom_stipple.c | 5 - >>> src/mesa/state_tracker/st_atom_storagebuf.c| 24 --- >>> src/mesa/state_tracker/st_atom_tess.c | 4 - >>> src/mesa/state_tracker/st_atom_texture.c | 24 --- >>> src/mesa/state_tracker/st_atom_viewport.c | 4 - >>> src/mesa/state_tracker/st_cb_bitmap.c | 10 +- >>> src/mesa/state_tracker/st_cb_bufferobjects.c | 10 +- >>> src/mesa/state_tracker/st_cb_compute.c | 2 +- >>> src/mesa/state_tracker/st_cb_feedback.c| 2 +- >>> src/mesa/state_tracker/st_cb_program.c | 38 ++--- >>> src/mesa/state_tracker/st_cb_texture.c | 2 +- >>> src/mesa/state_tracker/st_context.c| 100 ++-- >>> src/mesa/state_tracker/st_context.h| 42 + >>> src/mesa/state_tracker/st_draw.c | 4 +- >>> src/mesa/state_tracker/st_manager.c| 4 +- >>> 32 files changed, 377 insertions(+), 516 deletions(-) >>> create mode 100644 src/mesa/state_tracker/st_atom_list.h >>> >>> diff --git a/src/mesa/state_tracker/st_atom.c >>> b/src/mesa/state_tracker/st_atom.c >>> index 9d5cc0f..5843d2a 100644 >>> --- a/src/mesa/state_tracker/st_atom.c >>> +++ b/src/mesa/state_tracker/st_atom.c >>> @@ -37,87 +37,18 @@ >>> #include "st_manager.h" >>> >>> >>> -/** >>> - * This is used to initialize st->render_atoms[]. >>> - */ >>> -static const struct st_tracked_state *render_atoms[] = >>> -{ >>> - _update_depth_stencil_alpha, >>> - _update_clip, >>> - >>> - _update_fp, >>> - _update_gp, >>> - _update_tep, >>> - _update_tcp, >>> - _update_vp, >>> - >>> - _update_rasterizer, >>> - _update_polygon_stipple, >>> - _update_viewport, >>> - _update_scissor, >>> - _update_window_rectangles, >>> - _update_blend, >>> - _update_vertex_texture, >>> - _update_fragment_texture, >>> - _update_geometry_texture, >>> - _update_tessctrl_texture, >>> - _update_tesseval_texture, >>> - _update_sampler, /* depends on update_*_texture for swizzle */ >>> - _bind_vs_images, >>> - _bind_tcs_images, >>> - _bind_tes_images, >>> - _bind_gs_images, >>> - _bind_fs_images, >>> - _update_framebuffer, /* depends on update_*_texture and >>> bind_*_images */ >>> - _update_msaa, >>> - _update_sample_shading, >>> - _update_vs_constants, >>> - _update_tcs_constants, >>> - _update_tes_constants, >>> - _update_gs_constants, >>> - _update_fs_constants, >>> - _bind_vs_ubos, >>> - _bind_tcs_ubos, >>> - _bind_tes_ubos, >>> - _bind_fs_ubos, >>> - _bind_gs_ubos, >>> - _bind_vs_atomics, >>> - _bind_tcs_atomics, >>> - _bind_tes_atomics, >>> - _bind_fs_atomics, >>> - _bind_gs_atomics, >>> - _bind_vs_ssbos, >>> - _bind_tcs_ssbos, >>> - _bind_tes_ssbos, >>> - _bind_fs_ssbos, >>> - _bind_gs_ssbos, >>> - _update_pixel_transfer, >>> - _update_tess, >>> - >>> - /* this must be done after the vertex program update */ >>> - _update_array >>> -}; >>> - >>> - >>> -/** >>> - * This is used to initialize
Re: [Mesa-dev] [PATCH 3/9] st/mesa: completely rewrite state atoms
On Mon, Jul 25, 2016 at 11:16 AM, Brian Paulwrote: > On 07/18/2016 07:11 AM, Marek Olšák wrote: >> >> From: Marek Olšák >> >> The goal is to do this in st_validate_state: >> while (dirty) >>atoms[u_bit_scan()]->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. >> --- >> src/mesa/state_tracker/st_atom.c | 153 +- >> src/mesa/state_tracker/st_atom.h | 210 >> + >> src/mesa/state_tracker/st_atom_array.c | 4 - >> src/mesa/state_tracker/st_atom_atomicbuf.c | 24 --- >> src/mesa/state_tracker/st_atom_blend.c | 4 - >> src/mesa/state_tracker/st_atom_clip.c | 4 - >> src/mesa/state_tracker/st_atom_constbuf.c | 48 -- >> src/mesa/state_tracker/st_atom_depth.c | 4 - >> src/mesa/state_tracker/st_atom_framebuffer.c | 4 - >> src/mesa/state_tracker/st_atom_image.c | 24 --- >> src/mesa/state_tracker/st_atom_list.h | 75 + >> src/mesa/state_tracker/st_atom_msaa.c | 8 - >> src/mesa/state_tracker/st_atom_pixeltransfer.c | 4 - >> src/mesa/state_tracker/st_atom_rasterizer.c| 16 -- >> src/mesa/state_tracker/st_atom_sampler.c | 4 - >> src/mesa/state_tracker/st_atom_scissor.c | 8 - >> src/mesa/state_tracker/st_atom_shader.c| 24 --- >> src/mesa/state_tracker/st_atom_stipple.c | 5 - >> src/mesa/state_tracker/st_atom_storagebuf.c| 24 --- >> src/mesa/state_tracker/st_atom_tess.c | 4 - >> src/mesa/state_tracker/st_atom_texture.c | 24 --- >> src/mesa/state_tracker/st_atom_viewport.c | 4 - >> src/mesa/state_tracker/st_cb_bitmap.c | 10 +- >> src/mesa/state_tracker/st_cb_bufferobjects.c | 10 +- >> src/mesa/state_tracker/st_cb_compute.c | 2 +- >> src/mesa/state_tracker/st_cb_feedback.c| 2 +- >> src/mesa/state_tracker/st_cb_program.c | 38 ++--- >> src/mesa/state_tracker/st_cb_texture.c | 2 +- >> src/mesa/state_tracker/st_context.c| 100 ++-- >> src/mesa/state_tracker/st_context.h| 42 + >> src/mesa/state_tracker/st_draw.c | 4 +- >> src/mesa/state_tracker/st_manager.c| 4 +- >> 32 files changed, 377 insertions(+), 516 deletions(-) >> create mode 100644 src/mesa/state_tracker/st_atom_list.h >> >> diff --git a/src/mesa/state_tracker/st_atom.c >> b/src/mesa/state_tracker/st_atom.c >> index 9d5cc0f..5843d2a 100644 >> --- a/src/mesa/state_tracker/st_atom.c >> +++ b/src/mesa/state_tracker/st_atom.c >> @@ -37,87 +37,18 @@ >> #include "st_manager.h" >> >> >> -/** >> - * This is used to initialize st->render_atoms[]. >> - */ >> -static const struct st_tracked_state *render_atoms[] = >> -{ >> - _update_depth_stencil_alpha, >> - _update_clip, >> - >> - _update_fp, >> - _update_gp, >> - _update_tep, >> - _update_tcp, >> - _update_vp, >> - >> - _update_rasterizer, >> - _update_polygon_stipple, >> - _update_viewport, >> - _update_scissor, >> - _update_window_rectangles, >> - _update_blend, >> - _update_vertex_texture, >> - _update_fragment_texture, >> - _update_geometry_texture, >> - _update_tessctrl_texture, >> - _update_tesseval_texture, >> - _update_sampler, /* depends on update_*_texture for swizzle */ >> - _bind_vs_images, >> - _bind_tcs_images, >> - _bind_tes_images, >> - _bind_gs_images, >> - _bind_fs_images, >> - _update_framebuffer, /* depends on update_*_texture and >> bind_*_images */ >> - _update_msaa, >> - _update_sample_shading, >> - _update_vs_constants, >> - _update_tcs_constants, >> - _update_tes_constants, >> - _update_gs_constants, >> - _update_fs_constants, >> - _bind_vs_ubos, >> - _bind_tcs_ubos, >> - _bind_tes_ubos, >> - _bind_fs_ubos, >> - _bind_gs_ubos, >> - _bind_vs_atomics, >> - _bind_tcs_atomics, >> - _bind_tes_atomics, >> - _bind_fs_atomics, >> - _bind_gs_atomics, >> - _bind_vs_ssbos, >> - _bind_tcs_ssbos, >> - _bind_tes_ssbos, >> - _bind_fs_ssbos, >> - _bind_gs_ssbos, >> - _update_pixel_transfer, >> - _update_tess, >> - >> - /* this must be done after the vertex program update */ >> - _update_array >> -}; >> - >> - >> -/** >> - * This is used to initialize st->compute_atoms[]. >> - */ >> -static const struct st_tracked_state *compute_atoms[] = >> +/* The list state update functions. */ >> +static const struct st_tracked_state *atoms[] = >> { >> - _update_cp, >> -
Re: [Mesa-dev] [PATCH 3/9] st/mesa: completely rewrite state atoms
On 07/18/2016 07:11 AM, Marek Olšák wrote: From: Marek OlšákThe goal is to do this in st_validate_state: while (dirty) atoms[u_bit_scan()]->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. --- src/mesa/state_tracker/st_atom.c | 153 +- src/mesa/state_tracker/st_atom.h | 210 + src/mesa/state_tracker/st_atom_array.c | 4 - src/mesa/state_tracker/st_atom_atomicbuf.c | 24 --- src/mesa/state_tracker/st_atom_blend.c | 4 - src/mesa/state_tracker/st_atom_clip.c | 4 - src/mesa/state_tracker/st_atom_constbuf.c | 48 -- src/mesa/state_tracker/st_atom_depth.c | 4 - src/mesa/state_tracker/st_atom_framebuffer.c | 4 - src/mesa/state_tracker/st_atom_image.c | 24 --- src/mesa/state_tracker/st_atom_list.h | 75 + src/mesa/state_tracker/st_atom_msaa.c | 8 - src/mesa/state_tracker/st_atom_pixeltransfer.c | 4 - src/mesa/state_tracker/st_atom_rasterizer.c| 16 -- src/mesa/state_tracker/st_atom_sampler.c | 4 - src/mesa/state_tracker/st_atom_scissor.c | 8 - src/mesa/state_tracker/st_atom_shader.c| 24 --- src/mesa/state_tracker/st_atom_stipple.c | 5 - src/mesa/state_tracker/st_atom_storagebuf.c| 24 --- src/mesa/state_tracker/st_atom_tess.c | 4 - src/mesa/state_tracker/st_atom_texture.c | 24 --- src/mesa/state_tracker/st_atom_viewport.c | 4 - src/mesa/state_tracker/st_cb_bitmap.c | 10 +- src/mesa/state_tracker/st_cb_bufferobjects.c | 10 +- src/mesa/state_tracker/st_cb_compute.c | 2 +- src/mesa/state_tracker/st_cb_feedback.c| 2 +- src/mesa/state_tracker/st_cb_program.c | 38 ++--- src/mesa/state_tracker/st_cb_texture.c | 2 +- src/mesa/state_tracker/st_context.c| 100 ++-- src/mesa/state_tracker/st_context.h| 42 + src/mesa/state_tracker/st_draw.c | 4 +- src/mesa/state_tracker/st_manager.c| 4 +- 32 files changed, 377 insertions(+), 516 deletions(-) create mode 100644 src/mesa/state_tracker/st_atom_list.h diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 9d5cc0f..5843d2a 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -37,87 +37,18 @@ #include "st_manager.h" -/** - * This is used to initialize st->render_atoms[]. - */ -static const struct st_tracked_state *render_atoms[] = -{ - _update_depth_stencil_alpha, - _update_clip, - - _update_fp, - _update_gp, - _update_tep, - _update_tcp, - _update_vp, - - _update_rasterizer, - _update_polygon_stipple, - _update_viewport, - _update_scissor, - _update_window_rectangles, - _update_blend, - _update_vertex_texture, - _update_fragment_texture, - _update_geometry_texture, - _update_tessctrl_texture, - _update_tesseval_texture, - _update_sampler, /* depends on update_*_texture for swizzle */ - _bind_vs_images, - _bind_tcs_images, - _bind_tes_images, - _bind_gs_images, - _bind_fs_images, - _update_framebuffer, /* depends on update_*_texture and bind_*_images */ - _update_msaa, - _update_sample_shading, - _update_vs_constants, - _update_tcs_constants, - _update_tes_constants, - _update_gs_constants, - _update_fs_constants, - _bind_vs_ubos, - _bind_tcs_ubos, - _bind_tes_ubos, - _bind_fs_ubos, - _bind_gs_ubos, - _bind_vs_atomics, - _bind_tcs_atomics, - _bind_tes_atomics, - _bind_fs_atomics, - _bind_gs_atomics, - _bind_vs_ssbos, - _bind_tcs_ssbos, - _bind_tes_ssbos, - _bind_fs_ssbos, - _bind_gs_ssbos, - _update_pixel_transfer, - _update_tess, - - /* this must be done after the vertex program update */ - _update_array -}; - - -/** - * This is used to initialize st->compute_atoms[]. - */ -static const struct st_tracked_state *compute_atoms[] = +/* The list state update functions. */ +static const struct st_tracked_state *atoms[] = { - _update_cp, - _update_compute_texture, - _update_sampler, /* depends on update_compute_texture for swizzle */ - _update_cs_constants, - _bind_cs_ubos, - _bind_cs_atomics, - _bind_cs_ssbos, - _bind_cs_images, +#define ST_STATE(FLAG, st_update) _update, +#include "st_atom_list.h" +#undef ST_STATE }; void st_init_atoms( struct st_context *st ) { - /* no-op */ + STATIC_ASSERT(ARRAY_SIZE(atoms) <= 64); } @@ -127,13 +58,6 @@ void st_destroy_atoms( struct
Re: [Mesa-dev] [PATCH 3/9] st/mesa: completely rewrite state atoms
() On Mon, Jul 18, 2016 at 9:11 AM, Marek Olšákwrote: > From: Marek Olšák > > The goal is to do this in st_validate_state: >while (dirty) > atoms[u_bit_scan()]->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. > --- > src/mesa/state_tracker/st_atom.c | 153 +- > src/mesa/state_tracker/st_atom.h | 210 > + > src/mesa/state_tracker/st_atom_array.c | 4 - > src/mesa/state_tracker/st_atom_atomicbuf.c | 24 --- > src/mesa/state_tracker/st_atom_blend.c | 4 - > src/mesa/state_tracker/st_atom_clip.c | 4 - > src/mesa/state_tracker/st_atom_constbuf.c | 48 -- > src/mesa/state_tracker/st_atom_depth.c | 4 - > src/mesa/state_tracker/st_atom_framebuffer.c | 4 - > src/mesa/state_tracker/st_atom_image.c | 24 --- > src/mesa/state_tracker/st_atom_list.h | 75 + > src/mesa/state_tracker/st_atom_msaa.c | 8 - > src/mesa/state_tracker/st_atom_pixeltransfer.c | 4 - > src/mesa/state_tracker/st_atom_rasterizer.c| 16 -- > src/mesa/state_tracker/st_atom_sampler.c | 4 - > src/mesa/state_tracker/st_atom_scissor.c | 8 - > src/mesa/state_tracker/st_atom_shader.c| 24 --- > src/mesa/state_tracker/st_atom_stipple.c | 5 - > src/mesa/state_tracker/st_atom_storagebuf.c| 24 --- > src/mesa/state_tracker/st_atom_tess.c | 4 - > src/mesa/state_tracker/st_atom_texture.c | 24 --- > src/mesa/state_tracker/st_atom_viewport.c | 4 - > src/mesa/state_tracker/st_cb_bitmap.c | 10 +- > src/mesa/state_tracker/st_cb_bufferobjects.c | 10 +- > src/mesa/state_tracker/st_cb_compute.c | 2 +- > src/mesa/state_tracker/st_cb_feedback.c| 2 +- > src/mesa/state_tracker/st_cb_program.c | 38 ++--- > src/mesa/state_tracker/st_cb_texture.c | 2 +- > src/mesa/state_tracker/st_context.c| 100 ++-- > src/mesa/state_tracker/st_context.h| 42 + > src/mesa/state_tracker/st_draw.c | 4 +- > src/mesa/state_tracker/st_manager.c| 4 +- > 32 files changed, 377 insertions(+), 516 deletions(-) > create mode 100644 src/mesa/state_tracker/st_atom_list.h > > diff --git a/src/mesa/state_tracker/st_atom.c > b/src/mesa/state_tracker/st_atom.c > index 9d5cc0f..5843d2a 100644 > --- a/src/mesa/state_tracker/st_atom.c > +++ b/src/mesa/state_tracker/st_atom.c > @@ -37,87 +37,18 @@ > #include "st_manager.h" > > > -/** > - * This is used to initialize st->render_atoms[]. > - */ > -static const struct st_tracked_state *render_atoms[] = > -{ > - _update_depth_stencil_alpha, > - _update_clip, > - > - _update_fp, > - _update_gp, > - _update_tep, > - _update_tcp, > - _update_vp, > - > - _update_rasterizer, > - _update_polygon_stipple, > - _update_viewport, > - _update_scissor, > - _update_window_rectangles, > - _update_blend, > - _update_vertex_texture, > - _update_fragment_texture, > - _update_geometry_texture, > - _update_tessctrl_texture, > - _update_tesseval_texture, > - _update_sampler, /* depends on update_*_texture for swizzle */ > - _bind_vs_images, > - _bind_tcs_images, > - _bind_tes_images, > - _bind_gs_images, > - _bind_fs_images, > - _update_framebuffer, /* depends on update_*_texture and bind_*_images > */ > - _update_msaa, > - _update_sample_shading, > - _update_vs_constants, > - _update_tcs_constants, > - _update_tes_constants, > - _update_gs_constants, > - _update_fs_constants, > - _bind_vs_ubos, > - _bind_tcs_ubos, > - _bind_tes_ubos, > - _bind_fs_ubos, > - _bind_gs_ubos, > - _bind_vs_atomics, > - _bind_tcs_atomics, > - _bind_tes_atomics, > - _bind_fs_atomics, > - _bind_gs_atomics, > - _bind_vs_ssbos, > - _bind_tcs_ssbos, > - _bind_tes_ssbos, > - _bind_fs_ssbos, > - _bind_gs_ssbos, > - _update_pixel_transfer, > - _update_tess, > - > - /* this must be done after the vertex program update */ > - _update_array > -}; > - > - > -/** > - * This is used to initialize st->compute_atoms[]. > - */ > -static const struct st_tracked_state *compute_atoms[] = > +/* The list state update functions. */ > +static const struct st_tracked_state *atoms[] = > { > - _update_cp, > - _update_compute_texture, > - _update_sampler, /* depends on update_compute_texture for swizzle */ > - _update_cs_constants, > - _bind_cs_ubos, > - _bind_cs_atomics, > - _bind_cs_ssbos, > - _bind_cs_images, >
Re: [Mesa-dev] [PATCH 3/9] st/mesa: completely rewrite state atoms
Hi, On 18.07.2016 16:11, Marek Olšák wrote: torcs is 2% faster between the previous patch and the end of this series. "Driver" & "Driver2" tests included with GFXBench v4 could be good to check with this. They're fully CPU bound, synthetic 3D driver tests doing subset of stuff that the Manhattan benchmarks do: https://gfxbench.com/linux-download/ - Eero ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 3/9] st/mesa: completely rewrite state atoms
On 18 July 2016 at 14:11, Marek Olšákwrote: > From: Marek Olšák > > The goal is to do this in st_validate_state: >while (dirty) > atoms[u_bit_scan()]->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. Hell yea, -300 diff stat, 2% improvement and easier to follow code (from a quick skim) :-) > create mode 100644 src/mesa/state_tracker/st_atom_list.h Please add this to the STATETRACKER_FILES list in src/mesa/Makefile.sources. Thanks Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev