diff options
author | Marek Olšák <[email protected]> | 2019-09-30 16:45:48 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-10-16 20:10:47 -0400 |
commit | 33de483d55757024baafca9a69c2159a0a61481f (patch) | |
tree | 68ff5688afaa8796fdc1e1b5e8e9b884c7b5511a | |
parent | ab843a3702742977f51c9dea42d55c8ed805f8b9 (diff) |
st/mesa: simplify the signature of st_release_basic_variants
Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r-- | src/mesa/state_tracker/st_cb_program.c | 12 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 13 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.h | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_shader_cache.c | 12 |
4 files changed, 13 insertions, 28 deletions
diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 2d47af9b363..9ca1ada109d 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -112,8 +112,7 @@ st_delete_program(struct gl_context *ctx, struct gl_program *prog) { struct st_common_program *p = st_common_program(prog); - st_release_basic_variants(st, p->Base.Target, &p->variants, - &p->tgsi); + st_release_basic_variants(st, p); if (p->glsl_to_tgsi) free_glsl_to_tgsi_visitor(p->glsl_to_tgsi); @@ -184,8 +183,7 @@ st_program_string_notify( struct gl_context *ctx, else if (target == GL_GEOMETRY_PROGRAM_NV) { struct st_common_program *stgp = st_common_program(prog); - st_release_basic_variants(st, stgp->Base.Target, &stgp->variants, - &stgp->tgsi); + st_release_basic_variants(st, stgp); if (!st_translate_geometry_program(st, stgp)) return false; @@ -206,8 +204,7 @@ st_program_string_notify( struct gl_context *ctx, struct st_common_program *sttcp = st_common_program(prog); - st_release_basic_variants(st, sttcp->Base.Target, &sttcp->variants, - &sttcp->tgsi); + st_release_basic_variants(st, sttcp); if (!st_translate_tessctrl_program(st, sttcp)) return false; @@ -218,8 +215,7 @@ st_program_string_notify( struct gl_context *ctx, struct st_common_program *sttep = st_common_program(prog); - st_release_basic_variants(st, sttep->Base.Target, &sttep->variants, - &sttep->tgsi); + st_release_basic_variants(st, sttep); if (!st_translate_tesseval_program(st, sttep)) return false; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 3446388c966..73a2bf3d280 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -370,21 +370,18 @@ delete_basic_variant(struct st_context *st, struct st_basic_variant *v, * Free all basic program variants. */ void -st_release_basic_variants(struct st_context *st, GLenum target, - struct st_basic_variant **variants, - struct pipe_shader_state *tgsi) +st_release_basic_variants(struct st_context *st, struct st_common_program *p) { struct st_basic_variant *v; - for (v = *variants; v; ) { + for (v = p->variants; v; ) { struct st_basic_variant *next = v->next; - delete_basic_variant(st, v, target); + delete_basic_variant(st, v, p->Base.Target); v = next; } - *variants = NULL; - - delete_ir(tgsi); + p->variants = NULL; + delete_ir(&p->tgsi); } diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index 77b335993a5..4b0fcff96a7 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -450,9 +450,7 @@ st_release_cp_variants(struct st_context *st, struct st_compute_program *stcp); extern void -st_release_basic_variants(struct st_context *st, GLenum target, - struct st_basic_variant **variants, - struct pipe_shader_state *tgsi); +st_release_basic_variants(struct st_context *st, struct st_common_program *p); extern void st_destroy_program_variants(struct st_context *st); diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c index a56e9fa354c..344bd93d667 100644 --- a/src/mesa/state_tracker/st_shader_cache.c +++ b/src/mesa/state_tracker/st_shader_cache.c @@ -237,9 +237,7 @@ st_deserialise_ir_program(struct gl_context *ctx, case MESA_SHADER_TESS_CTRL: { struct st_common_program *sttcp = st_common_program(prog); - st_release_basic_variants(st, sttcp->Base.Target, - &sttcp->variants, &sttcp->tgsi); - + st_release_basic_variants(st, sttcp); read_stream_out_from_cache(&blob_reader, &sttcp->tgsi); if (nir) { @@ -260,9 +258,7 @@ st_deserialise_ir_program(struct gl_context *ctx, case MESA_SHADER_TESS_EVAL: { struct st_common_program *sttep = st_common_program(prog); - st_release_basic_variants(st, sttep->Base.Target, - &sttep->variants, &sttep->tgsi); - + st_release_basic_variants(st, sttep); read_stream_out_from_cache(&blob_reader, &sttep->tgsi); if (nir) { @@ -283,9 +279,7 @@ st_deserialise_ir_program(struct gl_context *ctx, case MESA_SHADER_GEOMETRY: { struct st_common_program *stgp = st_common_program(prog); - st_release_basic_variants(st, stgp->Base.Target, &stgp->variants, - &stgp->tgsi); - + st_release_basic_variants(st, stgp); read_stream_out_from_cache(&blob_reader, &stgp->tgsi); if (nir) { |