const ubyte *src[PIPE_MAX_ATTRIBS];
unsigned prim;
- struct draw_vs_varient_key key;
- struct draw_vs_varient *active;
+ struct draw_vs_variant_key key;
+ struct draw_vs_variant *active;
const struct vertex_info *vinfo;
}
- fse->active = draw_vs_lookup_varient( draw->vs.vertex_shader,
+ fse->active = draw_vs_lookup_variant( draw->vs.vertex_shader,
&fse->key );
if (!fse->active) {
{
unsigned i;
- for (i = 0; i < dvs->nr_varients; i++)
- dvs->varient[i]->destroy( dvs->varient[i] );
+ for (i = 0; i < dvs->nr_variants; i++)
+ dvs->variant[i]->destroy( dvs->variant[i] );
- dvs->nr_varients = 0;
+ dvs->nr_variants = 0;
dvs->delete( dvs );
}
}
-struct draw_vs_varient *
-draw_vs_lookup_varient( struct draw_vertex_shader *vs,
- const struct draw_vs_varient_key *key )
+struct draw_vs_variant *
+draw_vs_lookup_variant( struct draw_vertex_shader *vs,
+ const struct draw_vs_variant_key *key )
{
- struct draw_vs_varient *varient;
+ struct draw_vs_variant *variant;
unsigned i;
- /* Lookup existing varient:
+ /* Lookup existing variant:
*/
- for (i = 0; i < vs->nr_varients; i++)
- if (draw_vs_varient_key_compare(key, &vs->varient[i]->key) == 0)
- return vs->varient[i];
+ for (i = 0; i < vs->nr_variants; i++)
+ if (draw_vs_variant_key_compare(key, &vs->variant[i]->key) == 0)
+ return vs->variant[i];
/* Else have to create a new one:
*/
- varient = vs->create_varient( vs, key );
- if (varient == NULL)
+ variant = vs->create_variant( vs, key );
+ if (variant == NULL)
return NULL;
/* Add it to our list, could be smarter:
*/
- if (vs->nr_varients < Elements(vs->varient)) {
- vs->varient[vs->nr_varients++] = varient;
+ if (vs->nr_variants < Elements(vs->variant)) {
+ vs->variant[vs->nr_variants++] = variant;
}
else {
- vs->last_varient++;
- vs->last_varient %= Elements(vs->varient);
- vs->varient[vs->last_varient]->destroy(vs->varient[vs->last_varient]);
- vs->varient[vs->last_varient] = varient;
+ vs->last_variant++;
+ vs->last_variant %= Elements(vs->variant);
+ vs->variant[vs->last_variant]->destroy(vs->variant[vs->last_variant]);
+ vs->variant[vs->last_variant] = variant;
}
/* Done
*/
- return varient;
+ return variant;
}
struct draw_context;
struct pipe_shader_state;
-struct draw_varient_input
+struct draw_variant_input
{
enum pipe_format format;
unsigned buffer;
unsigned instance_divisor;
};
-struct draw_varient_output
+struct draw_variant_output
{
enum pipe_format format; /* output format */
unsigned vs_output:8; /* which vertex shader output is this? */
unsigned offset:24; /* offset into output vertex */
};
-struct draw_varient_element {
- struct draw_varient_input in;
- struct draw_varient_output out;
+struct draw_variant_element {
+ struct draw_variant_input in;
+ struct draw_variant_output out;
};
-struct draw_vs_varient_key {
+struct draw_vs_variant_key {
unsigned output_stride;
unsigned nr_elements:8; /* max2(nr_inputs, nr_outputs) */
unsigned nr_inputs:8;
unsigned viewport:1;
unsigned clip:1;
unsigned const_vbuffers:5;
- struct draw_varient_element element[PIPE_MAX_ATTRIBS];
+ struct draw_variant_element element[PIPE_MAX_ATTRIBS];
};
-struct draw_vs_varient;
+struct draw_vs_variant;
-struct draw_vs_varient {
- struct draw_vs_varient_key key;
+struct draw_vs_variant {
+ struct draw_vs_variant_key key;
struct draw_vertex_shader *vs;
- void (*set_buffer)( struct draw_vs_varient *,
+ void (*set_buffer)( struct draw_vs_variant *,
unsigned i,
const void *ptr,
unsigned stride,
unsigned max_stride );
- void (PIPE_CDECL *run_linear)( struct draw_vs_varient *shader,
+ void (PIPE_CDECL *run_linear)( struct draw_vs_variant *shader,
unsigned start,
unsigned count,
void *output_buffer );
- void (PIPE_CDECL *run_elts)( struct draw_vs_varient *shader,
+ void (PIPE_CDECL *run_elts)( struct draw_vs_variant *shader,
const unsigned *elts,
unsigned count,
void *output_buffer );
- void (*destroy)( struct draw_vs_varient * );
+ void (*destroy)( struct draw_vs_variant * );
};
/*
*/
- struct draw_vs_varient *varient[16];
- unsigned nr_varients;
- unsigned last_varient;
- struct draw_vs_varient *(*create_varient)( struct draw_vertex_shader *shader,
- const struct draw_vs_varient_key *key );
+ struct draw_vs_variant *variant[16];
+ unsigned nr_variants;
+ unsigned last_variant;
+ struct draw_vs_variant *(*create_variant)( struct draw_vertex_shader *shader,
+ const struct draw_vs_variant_key *key );
void (*prepare)( struct draw_vertex_shader *shader,
};
-struct draw_vs_varient *
-draw_vs_lookup_varient( struct draw_vertex_shader *base,
- const struct draw_vs_varient_key *key );
+struct draw_vs_variant *
+draw_vs_lookup_variant( struct draw_vertex_shader *base,
+ const struct draw_vs_variant_key *key );
/********************************************************************************
const struct pipe_shader_state *templ);
-struct draw_vs_varient_key;
+struct draw_vs_variant_key;
struct draw_vertex_shader;
-struct draw_vs_varient *
-draw_vs_create_varient_aos_sse( struct draw_vertex_shader *vs,
- const struct draw_vs_varient_key *key );
+struct draw_vs_variant *
+draw_vs_create_variant_aos_sse( struct draw_vertex_shader *vs,
+ const struct draw_vs_variant_key *key );
#if HAVE_LLVM
struct draw_vertex_shader *
/********************************************************************************
- * Helpers for vs implementations that don't do their own fetch/emit varients.
+ * Helpers for vs implementations that don't do their own fetch/emit variants.
* Means these can be shared between shaders.
*/
struct translate;
struct translate *draw_vs_get_emit( struct draw_context *draw,
struct translate_key *key );
-struct draw_vs_varient *
-draw_vs_create_varient_generic( struct draw_vertex_shader *vs,
- const struct draw_vs_varient_key *key );
+struct draw_vs_variant *
+draw_vs_create_variant_generic( struct draw_vertex_shader *vs,
+ const struct draw_vs_variant_key *key );
-static INLINE int draw_vs_varient_keysize( const struct draw_vs_varient_key *key )
+static INLINE int draw_vs_variant_keysize( const struct draw_vs_variant_key *key )
{
- return 2 * sizeof(int) + key->nr_elements * sizeof(struct draw_varient_element);
+ return 2 * sizeof(int) + key->nr_elements * sizeof(struct draw_variant_element);
}
-static INLINE int draw_vs_varient_key_compare( const struct draw_vs_varient_key *a,
- const struct draw_vs_varient_key *b )
+static INLINE int draw_vs_variant_key_compare( const struct draw_vs_variant_key *a,
+ const struct draw_vs_variant_key *b )
{
- int keysize = draw_vs_varient_keysize(a);
+ int keysize = draw_vs_variant_keysize(a);
return memcmp(a, b, keysize);
}
#define ARG_OUTBUF 4
-static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient,
+static boolean build_vertex_program( struct draw_vs_variant_aos_sse *variant,
boolean linear )
{
struct tgsi_parse_context parse;
util_init_math();
- tgsi_parse_init( &parse, varient->base.vs->state.tokens );
+ tgsi_parse_init( &parse, variant->base.vs->state.tokens );
memset(&cp, 0, sizeof(cp));
cp.insn_counter = 1;
- cp.vaos = varient;
+ cp.vaos = variant;
cp.have_sse2 = 1;
- cp.func = &varient->func[ linear ? 0 : 1 ];
+ cp.func = &variant->func[ linear ? 0 : 1 ];
cp.tmp_EAX = x86_make_reg(file_REG32, reg_AX);
cp.idx_EBX = x86_make_reg(file_REG32, reg_BX);
/** cast wrapper */
-static INLINE struct draw_vs_varient_aos_sse *
-draw_vs_varient_aos_sse(struct draw_vs_varient *varient)
+static INLINE struct draw_vs_variant_aos_sse *
+draw_vs_variant_aos_sse(struct draw_vs_variant *variant)
{
- return (struct draw_vs_varient_aos_sse *) varient;
+ return (struct draw_vs_variant_aos_sse *) variant;
}
-static void vaos_set_buffer( struct draw_vs_varient *varient,
+static void vaos_set_buffer( struct draw_vs_variant *variant,
unsigned buf,
const void *ptr,
unsigned stride,
unsigned max_stride)
{
- struct draw_vs_varient_aos_sse *vaos = draw_vs_varient_aos_sse(varient);
+ struct draw_vs_variant_aos_sse *vaos = draw_vs_variant_aos_sse(variant);
if (buf < vaos->nr_vb) {
vaos->buffer[buf].base_ptr = (char *)ptr;
-static void PIPE_CDECL vaos_run_elts( struct draw_vs_varient *varient,
+static void PIPE_CDECL vaos_run_elts( struct draw_vs_variant *variant,
const unsigned *elts,
unsigned count,
void *output_buffer )
{
- struct draw_vs_varient_aos_sse *vaos = draw_vs_varient_aos_sse(varient);
+ struct draw_vs_variant_aos_sse *vaos = draw_vs_variant_aos_sse(variant);
struct aos_machine *machine = vaos->draw->vs.aos_machine;
unsigned i;
output_buffer );
}
-static void PIPE_CDECL vaos_run_linear( struct draw_vs_varient *varient,
+static void PIPE_CDECL vaos_run_linear( struct draw_vs_variant *variant,
unsigned start,
unsigned count,
void *output_buffer )
{
- struct draw_vs_varient_aos_sse *vaos = draw_vs_varient_aos_sse(varient);
+ struct draw_vs_variant_aos_sse *vaos = draw_vs_variant_aos_sse(variant);
struct aos_machine *machine = vaos->draw->vs.aos_machine;
unsigned i;
-static void vaos_destroy( struct draw_vs_varient *varient )
+static void vaos_destroy( struct draw_vs_variant *variant )
{
- struct draw_vs_varient_aos_sse *vaos = draw_vs_varient_aos_sse(varient);
+ struct draw_vs_variant_aos_sse *vaos = draw_vs_variant_aos_sse(variant);
FREE( vaos->buffer );
-static struct draw_vs_varient *varient_aos_sse( struct draw_vertex_shader *vs,
- const struct draw_vs_varient_key *key )
+static struct draw_vs_variant *variant_aos_sse( struct draw_vertex_shader *vs,
+ const struct draw_vs_variant_key *key )
{
unsigned i;
- struct draw_vs_varient_aos_sse *vaos = CALLOC_STRUCT(draw_vs_varient_aos_sse);
+ struct draw_vs_variant_aos_sse *vaos = CALLOC_STRUCT(draw_vs_variant_aos_sse);
if (!vaos)
goto fail;
}
-struct draw_vs_varient *
-draw_vs_create_varient_aos_sse( struct draw_vertex_shader *vs,
- const struct draw_vs_varient_key *key )
+struct draw_vs_variant *
+draw_vs_create_variant_aos_sse( struct draw_vertex_shader *vs,
+ const struct draw_vs_variant_key *key )
{
- struct draw_vs_varient *varient = varient_aos_sse( vs, key );
+ struct draw_vs_variant *variant = variant_aos_sse( vs, key );
- if (varient == NULL) {
- varient = draw_vs_create_varient_generic( vs, key );
+ if (variant == NULL) {
+ variant = draw_vs_create_variant_generic( vs, key );
}
- return varient;
+ return variant;
}
-/* This is the temporary storage used by all the aos_sse vs varients.
+/* This is the temporary storage used by all the aos_sse vs variants.
* Create one per context and reuse by passing a pointer in at
- * vs_varient creation??
+ * vs_variant creation??
*/
struct aos_machine {
float input [MAX_INPUTS ][4];
struct aos_compilation {
struct x86_function *func;
- struct draw_vs_varient_aos_sse *vaos;
+ struct draw_vs_variant_aos_sse *vaos;
unsigned insn_counter;
unsigned num_immediates;
void *output_buffer);
-struct draw_vs_varient_aos_sse {
- struct draw_vs_varient base;
+struct draw_vs_variant_aos_sse {
+ struct draw_vs_variant base;
struct draw_context *draw;
struct aos_buffer *buffer;
vs->base.prepare = vs_exec_prepare;
vs->base.run_linear = vs_exec_run_linear;
vs->base.delete = vs_exec_delete;
- vs->base.create_varient = draw_vs_create_varient_generic;
+ vs->base.create_variant = draw_vs_create_variant_generic;
vs->machine = draw->vs.machine;
return &vs->base;
vs->base.prepare = vs_llvm_prepare;
vs->base.run_linear = vs_llvm_run_linear;
vs->base.delete = vs_llvm_delete;
- vs->base.create_varient = draw_vs_create_varient_generic;
+ vs->base.create_variant = draw_vs_create_variant_generic;
make_empty_list(&vs->variants);
vs->base.draw = draw;
#if 0
if (1)
- vs->base.create_varient = draw_vs_varient_aos_ppc;
+ vs->base.create_variant = draw_vs_variant_aos_ppc;
else
#endif
- vs->base.create_varient = draw_vs_create_varient_generic;
+ vs->base.create_variant = draw_vs_create_variant_generic;
vs->base.prepare = vs_ppc_prepare;
vs->base.run_linear = vs_ppc_run_linear;
vs->base.delete = vs_ppc_delete;
vs->base.draw = draw;
if (1)
- vs->base.create_varient = draw_vs_create_varient_aos_sse;
+ vs->base.create_variant = draw_vs_create_variant_aos_sse;
else
- vs->base.create_varient = draw_vs_create_varient_generic;
+ vs->base.create_variant = draw_vs_create_variant_generic;
vs->base.prepare = vs_sse_prepare;
vs->base.run_linear = vs_sse_run_linear;
vs->base.delete = vs_sse_delete;
/* A first pass at incorporating vertex fetch/emit functionality into
*/
-struct draw_vs_varient_generic {
- struct draw_vs_varient base;
+struct draw_vs_variant_generic {
+ struct draw_vs_variant base;
struct draw_vertex_shader *shader;
struct draw_context *draw;
-static void vsvg_set_buffer( struct draw_vs_varient *varient,
+static void vsvg_set_buffer( struct draw_vs_variant *variant,
unsigned buffer,
const void *ptr,
unsigned stride,
unsigned max_index )
{
- struct draw_vs_varient_generic *vsvg = (struct draw_vs_varient_generic *)varient;
+ struct draw_vs_variant_generic *vsvg = (struct draw_vs_variant_generic *)variant;
vsvg->fetch->set_buffer(vsvg->fetch,
buffer,
/* Mainly for debug at this stage:
*/
-static void do_rhw_viewport( struct draw_vs_varient_generic *vsvg,
+static void do_rhw_viewport( struct draw_vs_variant_generic *vsvg,
unsigned count,
void *output_buffer )
{
}
}
-static void do_viewport( struct draw_vs_varient_generic *vsvg,
+static void do_viewport( struct draw_vs_variant_generic *vsvg,
unsigned count,
void *output_buffer )
{
}
-static void PIPE_CDECL vsvg_run_elts( struct draw_vs_varient *varient,
+static void PIPE_CDECL vsvg_run_elts( struct draw_vs_variant *variant,
const unsigned *elts,
unsigned count,
void *output_buffer)
{
- struct draw_vs_varient_generic *vsvg = (struct draw_vs_varient_generic *)varient;
+ struct draw_vs_variant_generic *vsvg = (struct draw_vs_variant_generic *)variant;
unsigned temp_vertex_stride = vsvg->temp_vertex_stride;
void *temp_buffer = MALLOC( align(count,4) * temp_vertex_stride );
}
-static void PIPE_CDECL vsvg_run_linear( struct draw_vs_varient *varient,
+static void PIPE_CDECL vsvg_run_linear( struct draw_vs_variant *variant,
unsigned start,
unsigned count,
void *output_buffer )
{
- struct draw_vs_varient_generic *vsvg = (struct draw_vs_varient_generic *)varient;
+ struct draw_vs_variant_generic *vsvg = (struct draw_vs_variant_generic *)variant;
unsigned temp_vertex_stride = vsvg->temp_vertex_stride;
void *temp_buffer = MALLOC( align(count,4) * temp_vertex_stride );
-static void vsvg_destroy( struct draw_vs_varient *varient )
+static void vsvg_destroy( struct draw_vs_variant *variant )
{
- FREE(varient);
+ FREE(variant);
}
-struct draw_vs_varient *
-draw_vs_create_varient_generic( struct draw_vertex_shader *vs,
- const struct draw_vs_varient_key *key )
+struct draw_vs_variant *
+draw_vs_create_variant_generic( struct draw_vertex_shader *vs,
+ const struct draw_vs_variant_key *key )
{
unsigned i;
struct translate_key fetch, emit;
- struct draw_vs_varient_generic *vsvg = CALLOC_STRUCT( draw_vs_varient_generic );
+ struct draw_vs_variant_generic *vsvg = CALLOC_STRUCT( draw_vs_variant_generic );
if (vsvg == NULL)
return NULL;