On Sun, Jan 24, 2016 at 4:09 PM, Samuel Pitoiset <samuel.pitoi...@gmail.com> wrote: > Compute needs a new and different validation path. > > Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com> > --- > src/gallium/include/state_tracker/st_api.h | 8 +++++ > src/mesa/state_tracker/st_atom.c | 48 > ++++++++++++++++++++++++------ > src/mesa/state_tracker/st_atom.h | 4 ++- > src/mesa/state_tracker/st_cb_bitmap.c | 2 +- > src/mesa/state_tracker/st_cb_clear.c | 2 +- > src/mesa/state_tracker/st_cb_drawpixels.c | 4 +-- > src/mesa/state_tracker/st_cb_drawtex.c | 2 +- > src/mesa/state_tracker/st_cb_msaa.c | 2 +- > src/mesa/state_tracker/st_cb_rasterpos.c | 2 +- > src/mesa/state_tracker/st_cb_readpixels.c | 2 +- > src/mesa/state_tracker/st_context.c | 6 ++++ > src/mesa/state_tracker/st_context.h | 1 + > src/mesa/state_tracker/st_draw.c | 4 +-- > src/mesa/state_tracker/st_draw_feedback.c | 2 +- > 14 files changed, 68 insertions(+), 21 deletions(-) > > diff --git a/src/gallium/include/state_tracker/st_api.h > b/src/gallium/include/state_tracker/st_api.h > index 356863d..3f91d0b 100644 > --- a/src/gallium/include/state_tracker/st_api.h > +++ b/src/gallium/include/state_tracker/st_api.h > @@ -156,6 +156,14 @@ enum st_context_resource_type { > }; > > /** > + * Enumeration of state tracker pipelines. > + */ > +enum st_pipeline { > + ST_PIPELINE_RENDER, > + ST_PIPELINE_COMPUTE, > +}; > + > +/** > * Flush flags. > */ > #define ST_FLUSH_FRONT (1 << 0) > diff --git a/src/mesa/state_tracker/st_atom.c > b/src/mesa/state_tracker/st_atom.c > index 4b89ade..f989f47 100644 > --- a/src/mesa/state_tracker/st_atom.c > +++ b/src/mesa/state_tracker/st_atom.c > @@ -38,9 +38,9 @@ > > > /** > - * This is used to initialize st->atoms[]. > + * This is used to initialize st->render_atoms[]. > */ > -static const struct st_tracked_state *atoms[] = > +static const struct st_tracked_state *render_atoms[] = > { > &st_update_depth_stencil_alpha, > &st_update_clip, > @@ -93,6 +93,15 @@ static const struct st_tracked_state *atoms[] = > }; > > > +/** > + * This is used to initialize st->compute_atoms[]. > + */ > +static const struct st_tracked_state *compute_atoms[] = > +{ > + /* will be updated in the next commit */ > +}; > + > + > void st_init_atoms( struct st_context *st ) > { > /* no-op */ > @@ -178,20 +187,41 @@ static void check_attrib_edgeflag(struct st_context *st) > * Update all derived state: > */ > > -void st_validate_state( struct st_context *st ) > +void st_validate_state( struct st_context *st, enum st_pipeline pipeline ) > { > - struct st_state_flags *state = &st->dirty; > + const struct st_tracked_state **atoms; > + struct st_state_flags *state; > + GLuint num_atoms; > GLuint i; > > + /* Get pipeline state. */ > + switch (pipeline) { > + case ST_PIPELINE_RENDER: > + atoms = render_atoms; > + num_atoms = ARRAY_SIZE(render_atoms); > + state = &st->dirty; > + break; > + case ST_PIPELINE_COMPUTE: > + atoms = compute_atoms; > + num_atoms = ARRAY_SIZE(compute_atoms); > + state = &st->dirty_cp; > + break; > + default: > + assert(!"Invalid pipeline specified!");
Either mark this unreachable (i.e. unreachable("Invalid pipeline specified") ) or move this above the RENDER case so that it would fall through in opt builds and just validate the render pipeline. -ilia _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev