+void st_validate_state( struct st_context *st, enum st_pipeline pipeline );
+GLuint st_compare_func_to_pipe(GLenum func);
+
+void
+st_setup_arrays(struct st_context *st,
+ const struct st_vertex_program *vp,
+ const struct st_common_variant *vp_variant,
+ struct cso_velems_state *velements,
+ struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers,
+ bool *has_user_vertex_buffers);
+
+void
+st_setup_current_user(struct st_context *st,
+ const struct st_vertex_program *vp,
+ const struct st_common_variant *vp_variant,
+ struct cso_velems_state *velements,
+ struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers);
+
+/* Define ST_NEW_xxx_INDEX */
+enum {
+#define ST_STATE(FLAG, st_update) FLAG##_INDEX,
+#include "st_atom_list.h"
+#undef ST_STATE
+};
+
+/* Define ST_NEW_xxx values as static const uint64_t values.
+ * We can't use an enum type because MSVC doesn't allow 64-bit enum values.
+ */
+#define ST_STATE(FLAG, st_update) static const uint64_t FLAG = 1ull << FLAG##_INDEX;
+#include "st_atom_list.h"
+#undef ST_STATE
+
+/* Declare function prototypes. */
+#define ST_STATE(FLAG, st_update) void st_update(struct st_context *st);
+#include "st_atom_list.h"
+#undef ST_STATE
+
+/* Combined state flags. */
+#define ST_NEW_SAMPLERS (ST_NEW_VS_SAMPLERS | \
+ ST_NEW_TCS_SAMPLERS | \
+ ST_NEW_TES_SAMPLERS | \
+ ST_NEW_GS_SAMPLERS | \
+ ST_NEW_FS_SAMPLERS | \
+ ST_NEW_CS_SAMPLERS)
+
+#define ST_NEW_FRAMEBUFFER (ST_NEW_FB_STATE | \
+ ST_NEW_SAMPLE_STATE | \
+ ST_NEW_SAMPLE_SHADING)
+
+#define ST_NEW_VERTEX_PROGRAM(st, p) ((p)->affected_states | \
+ (st_user_clip_planes_enabled(st->ctx) ? \
+ ST_NEW_CLIP_STATE : 0))
+
+#define ST_NEW_CONSTANTS (ST_NEW_VS_CONSTANTS | \
+ ST_NEW_TCS_CONSTANTS | \
+ ST_NEW_TES_CONSTANTS | \
+ ST_NEW_FS_CONSTANTS | \
+ ST_NEW_GS_CONSTANTS | \
+ ST_NEW_CS_CONSTANTS)
+
+#define ST_NEW_UNIFORM_BUFFER (ST_NEW_VS_UBOS | \
+ ST_NEW_TCS_UBOS | \
+ ST_NEW_TES_UBOS | \
+ ST_NEW_FS_UBOS | \
+ ST_NEW_GS_UBOS | \
+ ST_NEW_CS_UBOS)
+
+#define ST_NEW_SAMPLER_VIEWS (ST_NEW_VS_SAMPLER_VIEWS | \
+ ST_NEW_FS_SAMPLER_VIEWS | \
+ ST_NEW_GS_SAMPLER_VIEWS | \
+ ST_NEW_TCS_SAMPLER_VIEWS | \
+ ST_NEW_TES_SAMPLER_VIEWS | \
+ ST_NEW_CS_SAMPLER_VIEWS)