/**
- * 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,
&st_bind_tes_atomics,
&st_bind_fs_atomics,
&st_bind_gs_atomics,
+ &st_bind_vs_ssbos,
+ &st_bind_tcs_ssbos,
+ &st_bind_tes_ssbos,
+ &st_bind_fs_ssbos,
+ &st_bind_gs_ssbos,
&st_update_pixel_transfer,
&st_update_tess,
};
+/**
+ * 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 */
* 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;
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;
}
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 );
}