{
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);
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;
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;
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;
* 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);
}
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);
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) {
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) {
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) {