diff options
Diffstat (limited to 'src/mesa/state_tracker/st_atom.c')
-rw-r--r-- | src/mesa/state_tracker/st_atom.c | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 4b89ade1b15..2d89512e854 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: + 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; - check_attrib_edgeflag(st); + if (pipeline == ST_PIPELINE_RENDER) { + check_attrib_edgeflag(st); - check_program_state( st ); + check_program_state(st); - st_manager_validate_framebuffers(st); + st_manager_validate_framebuffers(st); + } if (state->st == 0 && state->mesa == 0) return; @@ -211,7 +241,7 @@ void st_validate_state( struct st_context *st ) memset(&examined, 0, sizeof(examined)); prev = *state; - for (i = 0; i < ARRAY_SIZE(atoms); i++) { + for (i = 0; i < num_atoms; i++) { const struct st_tracked_state *atom = atoms[i]; struct st_state_flags generated; @@ -242,7 +272,7 @@ void st_validate_state( struct st_context *st ) } else { - for (i = 0; i < ARRAY_SIZE(atoms); i++) { + for (i = 0; i < num_atoms; i++) { if (check_state(state, &atoms[i]->dirty)) atoms[i]->update( st ); } |