struct st_context;
struct st_vertex_program;
-struct st_vp_variant;
+struct st_common_variant;
struct pipe_vertex_buffer;
struct pipe_vertex_element;
void
st_setup_arrays(struct st_context *st,
const struct st_vertex_program *vp,
- const struct st_vp_variant *vp_variant,
+ const struct st_common_variant *vp_variant,
struct pipe_vertex_element *velements,
struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers);
void
st_setup_current(struct st_context *st,
const struct st_vertex_program *vp,
- const struct st_vp_variant *vp_variant,
+ const struct st_common_variant *vp_variant,
struct pipe_vertex_element *velements,
struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers);
void
st_setup_current_user(struct st_context *st,
const struct st_vertex_program *vp,
- const struct st_vp_variant *vp_variant,
+ const struct st_common_variant *vp_variant,
struct pipe_vertex_element *velements,
struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers);
void
st_setup_arrays(struct st_context *st,
const struct st_vertex_program *vp,
- const struct st_vp_variant *vp_variant,
+ const struct st_common_variant *vp_variant,
struct pipe_vertex_element *velements,
struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers)
{
void
st_setup_current(struct st_context *st,
const struct st_vertex_program *vp,
- const struct st_vp_variant *vp_variant,
+ const struct st_common_variant *vp_variant,
struct pipe_vertex_element *velements,
struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers)
{
void
st_setup_current_user(struct st_context *st,
const struct st_vertex_program *vp,
- const struct st_vp_variant *vp_variant,
+ const struct st_common_variant *vp_variant,
struct pipe_vertex_element *velements,
struct pipe_vertex_buffer *vbuffer, unsigned *num_vbuffers)
{
/* vertex program validation must be done before this */
/* _NEW_PROGRAM, ST_NEW_VS_STATE */
const struct st_vertex_program *vp = (struct st_vertex_program *)st->vp;
- const struct st_vp_variant *vp_variant = st->vp_variant;
+ const struct st_common_variant *vp_variant = st->vp_variant;
struct pipe_vertex_buffer vbuffer[PIPE_MAX_ATTRIBS];
unsigned num_vbuffers = 0, first_upload_vbuffer;
if (st->shader_has_one_variant[MESA_SHADER_VERTEX] &&
stvp->variants &&
- st_vp_variant(stvp->variants)->key.passthrough_edgeflags == st->vertdata_edgeflags) {
- st->vp_variant = st_vp_variant(stvp->variants);
+ st_common_variant(stvp->variants)->key.passthrough_edgeflags == st->vertdata_edgeflags) {
+ st->vp_variant = st_common_variant(stvp->variants);
} else {
struct st_common_variant_key key;
struct gl_program *current_program[MESA_SHADER_STAGES];
};
- struct st_vp_variant *vp_variant;
+ struct st_common_variant *vp_variant;
struct {
struct pipe_resource *pixelmap_texture;
struct pipe_context *pipe = st->pipe;
struct draw_context *draw = st_get_draw_context(st);
const struct st_vertex_program *vp;
- struct st_vp_variant *vp_variant;
+ struct st_common_variant *vp_variant;
struct pipe_vertex_buffer vbuffers[PIPE_MAX_SHADER_INPUTS];
unsigned num_vbuffers = 0;
struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
static const gl_state_index16 depth_range_state[STATE_LENGTH] =
{ STATE_DEPTH_RANGE };
-static struct st_vp_variant *
+static struct st_common_variant *
st_create_vp_variant(struct st_context *st,
struct st_program *stvp,
const struct st_common_variant_key *key)
{
- struct st_vp_variant *vpv = CALLOC_STRUCT(st_vp_variant);
+ struct st_common_variant *vpv = CALLOC_STRUCT(st_common_variant);
struct pipe_context *pipe = st->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_shader_state state = {0};
/**
* Find/create a vertex program variant.
*/
-struct st_vp_variant *
+struct st_common_variant *
st_get_vp_variant(struct st_context *st,
struct st_program *stp,
const struct st_common_variant_key *key)
{
struct st_vertex_program *stvp = (struct st_vertex_program *)stp;
- struct st_vp_variant *vpv;
+ struct st_common_variant *vpv;
/* Search for existing variant */
- for (vpv = st_vp_variant(stp->variants); vpv;
- vpv = st_vp_variant(vpv->base.next)) {
+ for (vpv = st_common_variant(stp->variants); vpv;
+ vpv = st_common_variant(vpv->base.next)) {
if (memcmp(&vpv->key, key, sizeof(*key)) == 0) {
break;
}
};
-/**
- * This represents a vertex program, especially translated to match
- * the inputs of a particular fragment shader.
- */
-struct st_vp_variant
-{
- struct st_variant base;
-
- /* Parameters which generated this translated version of a vertex
- * shader:
- */
- struct st_common_variant_key key;
-
- /** Bitfield of VERT_BIT_* bits of mesa vertex processing inputs */
- GLbitfield vert_attrib_mask;
-};
-
-
/**
* Common shader variant.
*/
/* Parameters which generated this variant. */
struct st_common_variant_key key;
+
+ /* Bitfield of VERT_BIT_* bits matching vertex shader inputs,
+ * but not include the high part of doubles.
+ */
+ GLbitfield vert_attrib_mask;
};
return (struct st_common_variant*)v;
}
-static inline struct st_vp_variant *
-st_vp_variant(struct st_variant *v)
-{
- return (struct st_vp_variant*)v;
-}
-
static inline struct st_fp_variant *
st_fp_variant(struct st_variant *v)
{
extern void
st_set_prog_affected_state_flags(struct gl_program *prog);
-extern struct st_vp_variant *
+extern struct st_common_variant *
st_get_vp_variant(struct st_context *st,
struct st_program *stvp,
const struct st_common_variant_key *key);