draw: s/varient/variant/
authorBrian Paul <brianp@vmware.com>
Thu, 16 Dec 2010 15:50:42 +0000 (08:50 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 16 Dec 2010 17:18:24 +0000 (10:18 -0700)
src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
src/gallium/auxiliary/draw/draw_vs.c
src/gallium/auxiliary/draw/draw_vs.h
src/gallium/auxiliary/draw/draw_vs_aos.c
src/gallium/auxiliary/draw/draw_vs_aos.h
src/gallium/auxiliary/draw/draw_vs_exec.c
src/gallium/auxiliary/draw/draw_vs_llvm.c
src/gallium/auxiliary/draw/draw_vs_ppc.c
src/gallium/auxiliary/draw/draw_vs_sse.c
src/gallium/auxiliary/draw/draw_vs_varient.c

index 7c198c6026d955659cc0a84501d7591709799c22..c98fb3d5205a9dd4ed518e727ff416a9370287bc 100644 (file)
@@ -58,8 +58,8 @@ struct fetch_shade_emit {
    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;
@@ -150,7 +150,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
    }
 
    
-   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) {
index fb665b08fffc78963fb7af005bcc1bcec60f4e98..7caad6f0053a77d2d0cfc76de426c7b40e490197 100644 (file)
@@ -165,10 +165,10 @@ draw_delete_vertex_shader(struct draw_context *draw,
 {
    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 );
 }
@@ -225,40 +225,40 @@ draw_vs_destroy( struct draw_context *draw )
 }
 
 
-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;
 }
 
 
index f9a038788fba9856b94a6ff32c0a427d83a958f3..bfb72d50efab2e0f3fa0e197533d4cf6cb382d13 100644 (file)
@@ -38,7 +38,7 @@
 struct draw_context;
 struct pipe_shader_state;
 
-struct draw_varient_input 
+struct draw_variant_input 
 {
    enum pipe_format format;
    unsigned buffer;
@@ -46,19 +46,19 @@ struct draw_varient_input
    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;
@@ -66,34 +66,34 @@ struct draw_vs_varient_key {
    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 * );
 };
 
 
@@ -117,11 +117,11 @@ struct draw_vertex_shader {
 
    /* 
     */
-   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,
@@ -144,9 +144,9 @@ struct draw_vertex_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 );
 
 
 /********************************************************************************
@@ -166,12 +166,12 @@ draw_create_vs_ppc(struct draw_context *draw,
                   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 *
@@ -181,7 +181,7 @@ draw_create_vs_llvm(struct draw_context *draw,
 
 
 /********************************************************************************
- * 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;
@@ -194,21 +194,21 @@ struct translate *draw_vs_get_fetch( struct draw_context *draw,
 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);
 }
 
index 19f49e34c8bd5a9f7683131110d2a6f8c34a62af..7b90dba0cd53d69004d5d4a7ad003e2ae8d1b66b 100644 (file)
@@ -1918,7 +1918,7 @@ static void find_last_write_outputs( struct aos_compilation *cp )
 #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;
@@ -1927,14 +1927,14 @@ static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient,
 
    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);
@@ -2090,20 +2090,20 @@ static boolean build_vertex_program( struct draw_vs_varient_aos_sse *varient,
 
 
 /** 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;
@@ -2115,12 +2115,12 @@ static void vaos_set_buffer( struct draw_vs_varient *varient,
 
 
 
-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;
 
@@ -2139,12 +2139,12 @@ static void PIPE_CDECL vaos_run_elts( struct draw_vs_varient *varient,
                        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;
 
@@ -2171,9 +2171,9 @@ static void PIPE_CDECL vaos_run_linear( struct draw_vs_varient *varient,
 
 
 
-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 );
 
@@ -2185,11 +2185,11 @@ static void vaos_destroy( struct draw_vs_varient *varient )
 
 
 
-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;
@@ -2249,17 +2249,17 @@ static struct draw_vs_varient *varient_aos_sse( struct draw_vertex_shader *vs,
 }
 
 
-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;
 }
 
 
index 68e8295b5e117e063d8aad9007350d2c3ae75b40..55e63d8b9fabbc68a8319e25b23a4abde062767d 100644 (file)
@@ -98,9 +98,9 @@ struct aos_buffer {
 
 
 
-/* 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];
@@ -134,7 +134,7 @@ struct aos_machine {
 
 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;
@@ -234,8 +234,8 @@ typedef void (PIPE_CDECL *vaos_run_linear_func)( struct aos_machine *,
                                                 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;
index dab3eb1ca8eab68eca95182e966175d72770a998..667eb50785570d8210735541220e5b2f72427db7 100644 (file)
@@ -203,7 +203,7 @@ draw_create_vs_exec(struct draw_context *draw,
    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;
index de074be09264714acf59c64ac5473d54ca8555c7..54a5574f73ff25f07e75444f388bce9907e84253 100644 (file)
@@ -107,7 +107,7 @@ draw_create_vs_llvm(struct draw_context *draw,
    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);
 
index 5df84916c5126698139e150e1bd4d1f9b47f56ed..cf894bbe8af8f58f6d58019ed297da7368ede233 100644 (file)
@@ -187,10 +187,10 @@ draw_create_vs_ppc(struct draw_context *draw,
    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;
index 0b0c6077c6f07a3fd05c715d6e284dd6daf505cf..dee7c0da9b68ad6434913fda1b29f24b2735ab4d 100644 (file)
@@ -166,9 +166,9 @@ draw_create_vs_sse(struct draw_context *draw,
 
    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;
index eacd16018771bbe7da0785d0d7ad6263b02272a7..d8f030f61eb2f785d160d087107de45c98112690 100644 (file)
@@ -41,8 +41,8 @@
 
 /* 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;
@@ -63,13 +63,13 @@ struct draw_vs_varient_generic {
 
 
 
-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, 
@@ -81,7 +81,7 @@ static void vsvg_set_buffer( struct draw_vs_varient *varient,
 
 /* 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 )
 {
@@ -104,7 +104,7 @@ static void do_rhw_viewport( struct draw_vs_varient_generic *vsvg,
    }
 }
 
-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 )
 {
@@ -126,12 +126,12 @@ static void do_viewport( struct draw_vs_varient_generic *vsvg,
 }
                          
 
-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 );
    
@@ -193,12 +193,12 @@ static void PIPE_CDECL vsvg_run_elts( struct draw_vs_varient *varient,
 }
 
 
-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 );
        
@@ -259,20 +259,20 @@ static void PIPE_CDECL vsvg_run_linear( struct draw_vs_varient *varient,
 
 
 
-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;