From aa5ba96d294698809186cc4b59034abbd3076812 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Dec 2010 08:43:21 -0700 Subject: [PATCH] st/mesa: s/varient/variant --- src/mesa/state_tracker/st_atom_shader.c | 18 +-- src/mesa/state_tracker/st_cb_bitmap.c | 6 +- src/mesa/state_tracker/st_cb_drawpixels.c | 32 ++-- src/mesa/state_tracker/st_cb_program.c | 14 +- src/mesa/state_tracker/st_context.h | 6 +- src/mesa/state_tracker/st_debug.c | 4 +- src/mesa/state_tracker/st_draw.c | 12 +- src/mesa/state_tracker/st_draw_feedback.c | 8 +- src/mesa/state_tracker/st_program.c | 174 +++++++++++----------- src/mesa/state_tracker/st_program.h | 62 ++++---- 10 files changed, 168 insertions(+), 168 deletions(-) diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index f416293a7e4..c311d043931 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -74,7 +74,7 @@ static void update_fp( struct st_context *st ) { struct st_fragment_program *stfp; - struct st_fp_varient_key key; + struct st_fp_variant_key key; assert(st->ctx->FragmentProgram._Current); stfp = st_fragment_program(st->ctx->FragmentProgram._Current); @@ -83,7 +83,7 @@ update_fp( struct st_context *st ) memset(&key, 0, sizeof(key)); key.st = st; - st->fp_varient = st_get_fp_varient(st, stfp, &key); + st->fp_variant = st_get_fp_variant(st, stfp, &key); st_reference_fragprog(st, &st->fp, stfp); @@ -94,7 +94,7 @@ update_fp( struct st_context *st ) } else { cso_set_fragment_shader_handle(st->cso_context, - st->fp_varient->driver_shader); + st->fp_variant->driver_shader); } } @@ -118,7 +118,7 @@ static void update_vp( struct st_context *st ) { struct st_vertex_program *stvp; - struct st_vp_varient_key key; + struct st_vp_variant_key key; /* find active shader and params -- Should be covered by * ST_NEW_VERTEX_PROGRAM @@ -141,12 +141,12 @@ update_vp( struct st_context *st ) st->ctx->Polygon.FrontMode != GL_FILL || st->ctx->Polygon.BackMode != GL_FILL)); - st->vp_varient = st_get_vp_varient(st, stvp, &key); + st->vp_variant = st_get_vp_variant(st, stvp, &key); st_reference_vertprog(st, &st->vp, stvp); cso_set_vertex_shader_handle(st->cso_context, - st->vp_varient->driver_shader); + st->vp_variant->driver_shader); st->vertex_result_to_slot = stvp->result_to_output; } @@ -167,7 +167,7 @@ static void update_gp( struct st_context *st ) { struct st_geometry_program *stgp; - struct st_gp_varient_key key; + struct st_gp_variant_key key; if (!st->ctx->GeometryProgram._Current) { cso_set_geometry_shader_handle(st->cso_context, NULL); @@ -180,12 +180,12 @@ update_gp( struct st_context *st ) memset(&key, 0, sizeof(key)); key.st = st; - st->gp_varient = st_get_gp_varient(st, stgp, &key); + st->gp_variant = st_get_gp_variant(st, stgp, &key); st_reference_geomprog(st, &st->gp, stgp); cso_set_geometry_shader_handle(st->cso_context, - st->gp_varient->driver_shader); + st->gp_variant->driver_shader); } const struct st_tracked_state st_update_gp = { diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index d1d7e8f3710..516346c8c7a 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -412,8 +412,8 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; struct cso_context *cso = st->cso_context; - struct st_fp_varient *fpv; - struct st_fp_varient_key key; + struct st_fp_variant *fpv; + struct st_fp_variant_key key; GLuint maxSize; GLuint offset; @@ -421,7 +421,7 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, key.st = st; key.bitmap = GL_TRUE; - fpv = st_get_fp_varient(st, st->fp, &key); + fpv = st_get_fp_variant(st, st->fp, &key); /* As an optimization, Mesa's fragment programs will sometimes get the * primary color from a statevar/constant rather than a varying variable. diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 323e7e357ec..1fc47688e4a 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -846,12 +846,12 @@ draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, * Get fragment program variant for a glDrawPixels or glCopyPixels * command for RGBA data. */ -static struct st_fp_varient * -get_color_fp_varient(struct st_context *st) +static struct st_fp_variant * +get_color_fp_variant(struct st_context *st) { struct gl_context *ctx = st->ctx; - struct st_fp_varient_key key; - struct st_fp_varient *fpv; + struct st_fp_variant_key key; + struct st_fp_variant *fpv; memset(&key, 0, sizeof(key)); @@ -867,7 +867,7 @@ get_color_fp_varient(struct st_context *st) ctx->Pixel.AlphaScale != 1.0); key.pixelMaps = ctx->Pixel.MapColorFlag; - fpv = st_get_fp_varient(st, st->fp, &key); + fpv = st_get_fp_variant(st, st->fp, &key); return fpv; } @@ -877,12 +877,12 @@ get_color_fp_varient(struct st_context *st) * Get fragment program variant for a glDrawPixels or glCopyPixels * command for depth/stencil data. */ -static struct st_fp_varient * -get_depth_stencil_fp_varient(struct st_context *st, GLboolean write_depth, +static struct st_fp_variant * +get_depth_stencil_fp_variant(struct st_context *st, GLboolean write_depth, GLboolean write_stencil) { - struct st_fp_varient_key key; - struct st_fp_varient *fpv; + struct st_fp_variant_key key; + struct st_fp_variant *fpv; memset(&key, 0, sizeof(key)); @@ -891,7 +891,7 @@ get_depth_stencil_fp_varient(struct st_context *st, GLboolean write_depth, key.drawpixels_z = write_depth; key.drawpixels_stencil = write_stencil; - fpv = st_get_fp_varient(st, st->fp, &key); + fpv = st_get_fp_variant(st, st->fp, &key); return fpv; } @@ -914,7 +914,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, struct pipe_sampler_view *sv[2]; int num_sampler_view = 1; enum pipe_format stencil_format = PIPE_FORMAT_NONE; - struct st_fp_varient *fpv; + struct st_fp_variant *fpv; if (format == GL_DEPTH_STENCIL) write_stencil = write_depth = GL_TRUE; @@ -951,7 +951,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, * Get vertex/fragment shaders */ if (write_depth || write_stencil) { - fpv = get_depth_stencil_fp_varient(st, write_depth, write_stencil); + fpv = get_depth_stencil_fp_variant(st, write_depth, write_stencil); driver_fp = fpv->driver_shader; @@ -960,7 +960,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, color = ctx->Current.RasterColor; } else { - fpv = get_color_fp_varient(st); + fpv = get_color_fp_variant(st); driver_fp = fpv->driver_shader; @@ -1156,7 +1156,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, GLint readX, readY, readW, readH; GLuint sample_count; struct gl_pixelstore_attrib pack = ctx->DefaultPacking; - struct st_fp_varient *fpv; + struct st_fp_variant *fpv; st_validate_state(st); @@ -1173,7 +1173,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, rbRead = st_get_color_read_renderbuffer(ctx); color = NULL; - fpv = get_color_fp_varient(st); + fpv = get_color_fp_variant(st); driver_fp = fpv->driver_shader; driver_vp = make_passthrough_vertex_shader(st, GL_FALSE); @@ -1188,7 +1188,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer); color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - fpv = get_depth_stencil_fp_varient(st, GL_TRUE, GL_FALSE); + fpv = get_depth_stencil_fp_variant(st, GL_TRUE, GL_FALSE); driver_fp = fpv->driver_shader; driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 860d5a46de8..32694975d17 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -128,7 +128,7 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) case GL_VERTEX_PROGRAM_ARB: { struct st_vertex_program *stvp = (struct st_vertex_program *) prog; - st_release_vp_varients( st, stvp ); + st_release_vp_variants( st, stvp ); } break; case MESA_GEOMETRY_PROGRAM: @@ -136,7 +136,7 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) struct st_geometry_program *stgp = (struct st_geometry_program *) prog; - st_release_gp_varients(st, stgp); + st_release_gp_variants(st, stgp); if (stgp->tgsi.tokens) { st_free_tokens((void *) stgp->tgsi.tokens); @@ -149,7 +149,7 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) struct st_fragment_program *stfp = (struct st_fragment_program *) prog; - st_release_fp_varients(st, stfp); + st_release_fp_variants(st, stfp); if (stfp->tgsi.tokens) { st_free_tokens(stfp->tgsi.tokens); @@ -181,7 +181,7 @@ st_is_program_native(struct gl_context *ctx, /** * Called via ctx->Driver.ProgramStringNotify() * Called when the program's text/code is changed. We have to free - * all shader varients and corresponding gallium shaders when this happens. + * all shader variants and corresponding gallium shaders when this happens. */ static GLboolean st_program_string_notify( struct gl_context *ctx, @@ -193,7 +193,7 @@ st_program_string_notify( struct gl_context *ctx, if (target == GL_FRAGMENT_PROGRAM_ARB) { struct st_fragment_program *stfp = (struct st_fragment_program *) prog; - st_release_fp_varients(st, stfp); + st_release_fp_variants(st, stfp); if (stfp->tgsi.tokens) { st_free_tokens(stfp->tgsi.tokens); @@ -206,7 +206,7 @@ st_program_string_notify( struct gl_context *ctx, else if (target == MESA_GEOMETRY_PROGRAM) { struct st_geometry_program *stgp = (struct st_geometry_program *) prog; - st_release_gp_varients(st, stgp); + st_release_gp_variants(st, stgp); if (stgp->tgsi.tokens) { st_free_tokens((void *) stgp->tgsi.tokens); @@ -219,7 +219,7 @@ st_program_string_notify( struct gl_context *ctx, else if (target == GL_VERTEX_PROGRAM_ARB) { struct st_vertex_program *stvp = (struct st_vertex_program *) prog; - st_release_vp_varients( st, stvp ); + st_release_vp_variants( st, stvp ); if (st->vp == stvp) st->dirty.st |= ST_NEW_VERTEX_PROGRAM; diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 26565225e3b..68b52286d94 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -130,9 +130,9 @@ struct st_context struct st_fragment_program *fp; /**< Currently bound fragment program */ struct st_geometry_program *gp; /**< Currently bound geometry program */ - struct st_vp_varient *vp_varient; - struct st_fp_varient *fp_varient; - struct st_gp_varient *gp_varient; + struct st_vp_variant *vp_variant; + struct st_fp_variant *fp_variant; + struct st_gp_variant *gp_variant; struct gl_texture_object *default_texture; diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index df32491d044..e1e373d07d4 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -89,8 +89,8 @@ st_print_current(void) } #endif - if (st->vp->varients) - tgsi_dump( st->vp->varients[0].tgsi.tokens, 0 ); + if (st->vp->variants) + tgsi_dump( st->vp->variants[0].tgsi.tokens, 0 ); if (st->vp->Base.Base.Parameters) _mesa_print_parameter_list(st->vp->Base.Base.Parameters); diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 61a0e1b0877..f4bf1802390 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -241,7 +241,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, */ static GLboolean is_interleaved_arrays(const struct st_vertex_program *vp, - const struct st_vp_varient *vpv, + const struct st_vp_variant *vpv, const struct gl_client_array **arrays, GLboolean *userSpace) { @@ -297,7 +297,7 @@ is_interleaved_arrays(const struct st_vertex_program *vp, */ static void get_arrays_bounds(const struct st_vertex_program *vp, - const struct st_vp_varient *vpv, + const struct st_vp_variant *vpv, const struct gl_client_array **arrays, GLuint max_index, const GLubyte **low, const GLubyte **high) @@ -343,7 +343,7 @@ get_arrays_bounds(const struct st_vertex_program *vp, static void setup_interleaved_attribs(struct gl_context *ctx, const struct st_vertex_program *vp, - const struct st_vp_varient *vpv, + const struct st_vp_variant *vpv, const struct gl_client_array **arrays, GLuint max_index, GLboolean userSpace, @@ -409,7 +409,7 @@ setup_interleaved_attribs(struct gl_context *ctx, static void setup_non_interleaved_attribs(struct gl_context *ctx, const struct st_vertex_program *vp, - const struct st_vp_varient *vpv, + const struct st_vp_variant *vpv, const struct gl_client_array **arrays, GLuint max_index, GLboolean *userSpace, @@ -617,7 +617,7 @@ st_draw_vbo(struct gl_context *ctx, struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; const struct st_vertex_program *vp; - const struct st_vp_varient *vpv; + const struct st_vp_variant *vpv; struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS]; GLuint attr; struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS]; @@ -650,7 +650,7 @@ st_draw_vbo(struct gl_context *ctx, /* must get these after state validation! */ vp = st->vp; - vpv = st->vp_varient; + vpv = st->vp_variant; #if 0 if (MESA_VERBOSE & VERBOSE_GLSL) { diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 7f392fc4916..0a6cebb84cc 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -123,10 +123,10 @@ st_feedback_draw_vbo(struct gl_context *ctx, /* must get these after state validation! */ vp = st->vp; - vs = &st->vp_varient->tgsi; + vs = &st->vp_variant->tgsi; - if (!st->vp_varient->draw_shader) { - st->vp_varient->draw_shader = draw_create_vertex_shader(draw, vs); + if (!st->vp_variant->draw_shader) { + st->vp_variant->draw_shader = draw_create_vertex_shader(draw, vs); } /* @@ -139,7 +139,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, draw_set_viewport_state(draw, &st->state.viewport); draw_set_clip_state(draw, &st->state.clip); draw_set_rasterizer_state(draw, &st->state.rasterizer, NULL); - draw_bind_vertex_shader(draw, st->vp_varient->draw_shader); + draw_bind_vertex_shader(draw, st->vp_variant->draw_shader); set_feedback_vertex_format(ctx); /* loop over TGSI shader inputs to determine vertex buffer diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index bbd3cdbfacb..cfdc96b9dbe 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -56,11 +56,11 @@ /** - * Delete a vertex program varient. Note the caller must unlink - * the varient from the linked list. + * Delete a vertex program variant. Note the caller must unlink + * the variant from the linked list. */ static void -delete_vp_varient(struct st_context *st, struct st_vp_varient *vpv) +delete_vp_variant(struct st_context *st, struct st_vp_variant *vpv) { if (vpv->driver_shader) cso_delete_vertex_shader(st->cso_context, vpv->driver_shader); @@ -82,28 +82,28 @@ delete_vp_varient(struct st_context *st, struct st_vp_varient *vpv) * Clean out any old compilations: */ void -st_release_vp_varients( struct st_context *st, +st_release_vp_variants( struct st_context *st, struct st_vertex_program *stvp ) { - struct st_vp_varient *vpv; + struct st_vp_variant *vpv; - for (vpv = stvp->varients; vpv; ) { - struct st_vp_varient *next = vpv->next; - delete_vp_varient(st, vpv); + for (vpv = stvp->variants; vpv; ) { + struct st_vp_variant *next = vpv->next; + delete_vp_variant(st, vpv); vpv = next; } - stvp->varients = NULL; + stvp->variants = NULL; } /** - * Delete a fragment program varient. Note the caller must unlink - * the varient from the linked list. + * Delete a fragment program variant. Note the caller must unlink + * the variant from the linked list. */ static void -delete_fp_varient(struct st_context *st, struct st_fp_varient *fpv) +delete_fp_variant(struct st_context *st, struct st_fp_variant *fpv) { if (fpv->driver_shader) cso_delete_fragment_shader(st->cso_context, fpv->driver_shader); @@ -113,29 +113,29 @@ delete_fp_varient(struct st_context *st, struct st_fp_varient *fpv) /** - * Free all varients of a fragment program. + * Free all variants of a fragment program. */ void -st_release_fp_varients(struct st_context *st, struct st_fragment_program *stfp) +st_release_fp_variants(struct st_context *st, struct st_fragment_program *stfp) { - struct st_fp_varient *fpv; + struct st_fp_variant *fpv; - for (fpv = stfp->varients; fpv; ) { - struct st_fp_varient *next = fpv->next; - delete_fp_varient(st, fpv); + for (fpv = stfp->variants; fpv; ) { + struct st_fp_variant *next = fpv->next; + delete_fp_variant(st, fpv); fpv = next; } - stfp->varients = NULL; + stfp->variants = NULL; } /** - * Delete a geometry program varient. Note the caller must unlink - * the varient from the linked list. + * Delete a geometry program variant. Note the caller must unlink + * the variant from the linked list. */ static void -delete_gp_varient(struct st_context *st, struct st_gp_varient *gpv) +delete_gp_variant(struct st_context *st, struct st_gp_variant *gpv) { if (gpv->driver_shader) cso_delete_geometry_shader(st->cso_context, gpv->driver_shader); @@ -145,20 +145,20 @@ delete_gp_varient(struct st_context *st, struct st_gp_varient *gpv) /** - * Free all varients of a geometry program. + * Free all variants of a geometry program. */ void -st_release_gp_varients(struct st_context *st, struct st_geometry_program *stgp) +st_release_gp_variants(struct st_context *st, struct st_geometry_program *stgp) { - struct st_gp_varient *gpv; + struct st_gp_variant *gpv; - for (gpv = stgp->varients; gpv; ) { - struct st_gp_varient *next = gpv->next; - delete_gp_varient(st, gpv); + for (gpv = stgp->variants; gpv; ) { + struct st_gp_variant *next = gpv->next; + delete_gp_variant(st, gpv); gpv = next; } - stgp->varients = NULL; + stgp->variants = NULL; } @@ -276,14 +276,14 @@ st_prepare_vertex_program(struct st_context *st, /** - * Translate a vertex program to create a new varient. + * Translate a vertex program to create a new variant. */ -static struct st_vp_varient * +static struct st_vp_variant * st_translate_vertex_program(struct st_context *st, struct st_vertex_program *stvp, - const struct st_vp_varient_key *key) + const struct st_vp_variant_key *key) { - struct st_vp_varient *vpv = CALLOC_STRUCT(st_vp_varient); + struct st_vp_variant *vpv = CALLOC_STRUCT(st_vp_variant); struct pipe_context *pipe = st->pipe; struct ureg_program *ureg; enum pipe_error error; @@ -361,17 +361,17 @@ fail: /** - * Find/create a vertex program varient. + * Find/create a vertex program variant. */ -struct st_vp_varient * -st_get_vp_varient(struct st_context *st, +struct st_vp_variant * +st_get_vp_variant(struct st_context *st, struct st_vertex_program *stvp, - const struct st_vp_varient_key *key) + const struct st_vp_variant_key *key) { - struct st_vp_varient *vpv; + struct st_vp_variant *vpv; - /* Search for existing varient */ - for (vpv = stvp->varients; vpv; vpv = vpv->next) { + /* Search for existing variant */ + for (vpv = stvp->variants; vpv; vpv = vpv->next) { if (memcmp(&vpv->key, key, sizeof(*key)) == 0) { break; } @@ -382,8 +382,8 @@ st_get_vp_varient(struct st_context *st, vpv = st_translate_vertex_program(st, stvp, key); if (vpv) { /* insert into list */ - vpv->next = stvp->varients; - stvp->varients = vpv; + vpv->next = stvp->variants; + stvp->variants = vpv; } } @@ -396,15 +396,15 @@ st_get_vp_varient(struct st_context *st, * the key. * \return new fragment program variant */ -static struct st_fp_varient * +static struct st_fp_variant * st_translate_fragment_program(struct st_context *st, struct st_fragment_program *stfp, - const struct st_fp_varient_key *key) + const struct st_fp_variant_key *key) { struct pipe_context *pipe = st->pipe; - struct st_fp_varient *varient = CALLOC_STRUCT(st_fp_varient); + struct st_fp_variant *variant = CALLOC_STRUCT(st_fp_variant); - if (!varient) + if (!variant) return NULL; assert(!(key->bitmap && key->drawpixels)); @@ -414,9 +414,9 @@ st_translate_fragment_program(struct st_context *st, struct gl_fragment_program *fp; st_make_bitmap_fragment_program(st, &stfp->Base, - &fp, &varient->bitmap_sampler); + &fp, &variant->bitmap_sampler); - varient->parameters = _mesa_clone_parameter_list(fp->Base.Parameters); + variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters); stfp = st_fragment_program(fp); } else if (key->drawpixels) { @@ -430,7 +430,7 @@ st_translate_fragment_program(struct st_context *st, else { /* RGBA */ st_make_drawpix_fragment_program(st, &stfp->Base, &fp); - varient->parameters = _mesa_clone_parameter_list(fp->Base.Parameters); + variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters); } stfp = st_fragment_program(fp); } @@ -613,31 +613,31 @@ st_translate_fragment_program(struct st_context *st, ureg_destroy( ureg ); } - /* fill in varient */ - varient->driver_shader = pipe->create_fs_state(pipe, &stfp->tgsi); - varient->key = *key; + /* fill in variant */ + variant->driver_shader = pipe->create_fs_state(pipe, &stfp->tgsi); + variant->key = *key; if (ST_DEBUG & DEBUG_TGSI) { tgsi_dump( stfp->tgsi.tokens, 0/*TGSI_DUMP_VERBOSE*/ ); debug_printf("\n"); } - return varient; + return variant; } /** * Translate fragment program if needed. */ -struct st_fp_varient * -st_get_fp_varient(struct st_context *st, +struct st_fp_variant * +st_get_fp_variant(struct st_context *st, struct st_fragment_program *stfp, - const struct st_fp_varient_key *key) + const struct st_fp_variant_key *key) { - struct st_fp_varient *fpv; + struct st_fp_variant *fpv; - /* Search for existing varient */ - for (fpv = stfp->varients; fpv; fpv = fpv->next) { + /* Search for existing variant */ + for (fpv = stfp->variants; fpv; fpv = fpv->next) { if (memcmp(&fpv->key, key, sizeof(*key)) == 0) { break; } @@ -648,8 +648,8 @@ st_get_fp_varient(struct st_context *st, fpv = st_translate_fragment_program(st, stfp, key); if (fpv) { /* insert into list */ - fpv->next = stfp->varients; - stfp->varients = fpv; + fpv->next = stfp->variants; + stfp->variants = fpv; } } @@ -658,12 +658,12 @@ st_get_fp_varient(struct st_context *st, /** - * Translate a geometry program to create a new varient. + * Translate a geometry program to create a new variant. */ -static struct st_gp_varient * +static struct st_gp_variant * st_translate_geometry_program(struct st_context *st, struct st_geometry_program *stgp, - const struct st_gp_varient_key *key) + const struct st_gp_variant_key *key) { GLuint inputMapping[GEOM_ATTRIB_MAX]; GLuint outputMapping[GEOM_RESULT_MAX]; @@ -686,9 +686,9 @@ st_translate_geometry_program(struct st_context *st, GLuint maxSlot = 0; struct ureg_program *ureg; - struct st_gp_varient *gpv; + struct st_gp_variant *gpv; - gpv = CALLOC_STRUCT(st_gp_varient); + gpv = CALLOC_STRUCT(st_gp_variant); if (!gpv) return NULL; @@ -896,7 +896,7 @@ st_translate_geometry_program(struct st_context *st, stgp->tgsi.tokens = ureg_get_tokens( ureg, NULL ); ureg_destroy( ureg ); - /* fill in new varient */ + /* fill in new variant */ gpv->driver_shader = pipe->create_gs_state(pipe, &stgp->tgsi); gpv->key = *key; @@ -917,15 +917,15 @@ st_translate_geometry_program(struct st_context *st, /** * Get/create geometry program variant. */ -struct st_gp_varient * -st_get_gp_varient(struct st_context *st, +struct st_gp_variant * +st_get_gp_variant(struct st_context *st, struct st_geometry_program *stgp, - const struct st_gp_varient_key *key) + const struct st_gp_variant_key *key) { - struct st_gp_varient *gpv; + struct st_gp_variant *gpv; - /* Search for existing varient */ - for (gpv = stgp->varients; gpv; gpv = gpv->next) { + /* Search for existing variant */ + for (gpv = stgp->variants; gpv; gpv = gpv->next) { if (memcmp(&gpv->key, key, sizeof(*key)) == 0) { break; } @@ -936,8 +936,8 @@ st_get_gp_varient(struct st_context *st, gpv = st_translate_geometry_program(st, stgp, key); if (gpv) { /* insert into list */ - gpv->next = stgp->varients; - stgp->varients = gpv; + gpv->next = stgp->variants; + stgp->variants = gpv; } } @@ -1008,15 +1008,15 @@ destroy_program_variants(struct st_context *st, struct gl_program *program) case GL_VERTEX_PROGRAM_ARB: { struct st_vertex_program *stvp = (struct st_vertex_program *) program; - struct st_vp_varient *vpv, **prevPtr = &stvp->varients; + struct st_vp_variant *vpv, **prevPtr = &stvp->variants; - for (vpv = stvp->varients; vpv; ) { - struct st_vp_varient *next = vpv->next; + for (vpv = stvp->variants; vpv; ) { + struct st_vp_variant *next = vpv->next; if (vpv->key.st == st) { /* unlink from list */ *prevPtr = next; /* destroy this variant */ - delete_vp_varient(st, vpv); + delete_vp_variant(st, vpv); } else { prevPtr = &vpv->next; @@ -1029,15 +1029,15 @@ destroy_program_variants(struct st_context *st, struct gl_program *program) { struct st_fragment_program *stfp = (struct st_fragment_program *) program; - struct st_fp_varient *fpv, **prevPtr = &stfp->varients; + struct st_fp_variant *fpv, **prevPtr = &stfp->variants; - for (fpv = stfp->varients; fpv; ) { - struct st_fp_varient *next = fpv->next; + for (fpv = stfp->variants; fpv; ) { + struct st_fp_variant *next = fpv->next; if (fpv->key.st == st) { /* unlink from list */ *prevPtr = next; /* destroy this variant */ - delete_fp_varient(st, fpv); + delete_fp_variant(st, fpv); } else { prevPtr = &fpv->next; @@ -1050,15 +1050,15 @@ destroy_program_variants(struct st_context *st, struct gl_program *program) { struct st_geometry_program *stgp = (struct st_geometry_program *) program; - struct st_gp_varient *gpv, **prevPtr = &stgp->varients; + struct st_gp_variant *gpv, **prevPtr = &stgp->variants; - for (gpv = stgp->varients; gpv; ) { - struct st_gp_varient *next = gpv->next; + for (gpv = stgp->variants; gpv; ) { + struct st_gp_variant *next = gpv->next; if (gpv->key.st == st) { /* unlink from list */ *prevPtr = next; /* destroy this variant */ - delete_gp_varient(st, gpv); + delete_gp_variant(st, gpv); } else { prevPtr = &gpv->next; diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 0cf81caa267..c4244df939e 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -41,15 +41,15 @@ /** Fragment program variant key */ -struct st_fp_varient_key +struct st_fp_variant_key { struct st_context *st; /**< variants are per-context */ /** for glBitmap */ - GLuint bitmap:1; /**< glBitmap varient? */ + GLuint bitmap:1; /**< glBitmap variant? */ /** for glDrawPixels */ - GLuint drawpixels:1; /**< glDrawPixels varient */ + GLuint drawpixels:1; /**< glDrawPixels variant */ GLuint scaleAndBias:1; /**< glDrawPixels w/ scale and/or bias? */ GLuint pixelMaps:1; /**< glDrawPixels w/ pixel lookup map? */ GLuint drawpixels_z:1; /**< glDrawPixels(GL_DEPTH) */ @@ -60,10 +60,10 @@ struct st_fp_varient_key /** * Variant of a fragment program. */ -struct st_fp_varient +struct st_fp_variant { /** Parameters which generated this version of fragment program */ - struct st_fp_varient_key key; + struct st_fp_variant_key key; /** Driver's compiled shader */ void *driver_shader; @@ -73,7 +73,7 @@ struct st_fp_varient uint bitmap_sampler; /** next in linked list */ - struct st_fp_varient *next; + struct st_fp_variant *next; }; @@ -86,13 +86,13 @@ struct st_fragment_program struct pipe_shader_state tgsi; - struct st_fp_varient *varients; + struct st_fp_variant *variants; }; /** Vertex program variant key */ -struct st_vp_varient_key +struct st_vp_variant_key { struct st_context *st; /**< variants are per-context */ boolean passthrough_edgeflags; @@ -103,12 +103,12 @@ struct st_vp_varient_key * This represents a vertex program, especially translated to match * the inputs of a particular fragment shader. */ -struct st_vp_varient +struct st_vp_variant { /* Parameters which generated this translated version of a vertex * shader: */ - struct st_vp_varient_key key; + struct st_vp_variant_key key; /** * TGSI tokens (to later generate a 'draw' module shader for @@ -123,7 +123,7 @@ struct st_vp_varient struct draw_vertex_shader *draw_shader; /** Next in linked list */ - struct st_vp_varient *next; + struct st_vp_variant *next; /** similar to that in st_vertex_program, but with edgeflags info too */ GLuint num_inputs; @@ -149,15 +149,15 @@ struct st_vertex_program ubyte output_semantic_index[VERT_RESULT_MAX]; GLuint num_outputs; - /** List of translated varients of this vertex program. + /** List of translated variants of this vertex program. */ - struct st_vp_varient *varients; + struct st_vp_variant *variants; }; -/** Geometry program varient key */ -struct st_gp_varient_key +/** Geometry program variant key */ +struct st_gp_variant_key { struct st_context *st; /**< variants are per-context */ /* no other fields yet */ @@ -167,14 +167,14 @@ struct st_gp_varient_key /** * Geometry program variant. */ -struct st_gp_varient +struct st_gp_variant { /* Parameters which generated this translated version of a vertex */ - struct st_gp_varient_key key; + struct st_gp_variant_key key; void *driver_shader; - struct st_gp_varient *next; + struct st_gp_variant *next; }; @@ -203,7 +203,7 @@ struct st_geometry_program struct pipe_shader_state tgsi; - struct st_gp_varient *varients; + struct st_gp_variant *variants; }; @@ -258,35 +258,35 @@ st_reference_fragprog(struct st_context *st, } -extern struct st_vp_varient * -st_get_vp_varient(struct st_context *st, +extern struct st_vp_variant * +st_get_vp_variant(struct st_context *st, struct st_vertex_program *stvp, - const struct st_vp_varient_key *key); + const struct st_vp_variant_key *key); -extern struct st_fp_varient * -st_get_fp_varient(struct st_context *st, +extern struct st_fp_variant * +st_get_fp_variant(struct st_context *st, struct st_fragment_program *stfp, - const struct st_fp_varient_key *key); + const struct st_fp_variant_key *key); -extern struct st_gp_varient * -st_get_gp_varient(struct st_context *st, +extern struct st_gp_variant * +st_get_gp_variant(struct st_context *st, struct st_geometry_program *stgp, - const struct st_gp_varient_key *key); + const struct st_gp_variant_key *key); extern void -st_release_vp_varients( struct st_context *st, +st_release_vp_variants( struct st_context *st, struct st_vertex_program *stvp ); extern void -st_release_fp_varients( struct st_context *st, +st_release_fp_variants( struct st_context *st, struct st_fragment_program *stfp ); extern void -st_release_gp_varients(struct st_context *st, +st_release_gp_variants(struct st_context *st, struct st_geometry_program *stgp); -- 2.30.2