X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fstate_tracker%2Fst_program.c;h=53781e6c01e2f8d3fa05964820f37ccc13d45993;hb=5a714531f7189f9e2e0059218b5004c3cbfc687e;hp=12061ed91f1072d5710556f0f1af24be97bdb816;hpb=6cf011fcc8131c32ccccba2cf8dcb6cc12699e5e;p=mesa.git diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 12061ed91f1..53781e6c01e 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -653,10 +653,9 @@ st_translate_vertex_program(struct st_context *st, nir_shader *nir = st_translate_prog_to_nir(st, &stp->Base, MESA_SHADER_VERTEX); - if (stp->state.ir.nir) - ralloc_free(stp->state.ir.nir); + if (stp->Base.nir) + ralloc_free(stp->Base.nir); stp->state.type = PIPE_SHADER_IR_NIR; - stp->state.ir.nir = nir; stp->Base.nir = nir; return true; } @@ -690,7 +689,7 @@ st_create_vp_variant(struct st_context *st, bool finalize = false; state.type = PIPE_SHADER_IR_NIR; - state.ir.nir = nir_shader_clone(NULL, stvp->state.ir.nir); + state.ir.nir = nir_shader_clone(NULL, stvp->Base.nir); if (key->clamp_color) { NIR_PASS_V(state.ir.nir, nir_lower_clamp_color_outputs); finalize = true; @@ -886,10 +885,9 @@ st_translate_fragment_program(struct st_context *st, nir_shader *nir = st_translate_prog_to_nir(st, &stfp->Base, MESA_SHADER_FRAGMENT); - if (stfp->state.ir.nir) - ralloc_free(stfp->state.ir.nir); + if (stfp->Base.nir) + ralloc_free(stfp->Base.nir); stfp->state.type = PIPE_SHADER_IR_NIR; - stfp->state.ir.nir = nir; stfp->Base.nir = nir; return true; } @@ -1246,7 +1244,7 @@ st_create_fp_variant(struct st_context *st, bool finalize = false; state.type = PIPE_SHADER_IR_NIR; - state.ir.nir = nir_shader_clone(NULL, stfp->state.ir.nir); + state.ir.nir = nir_shader_clone(NULL, stfp->Base.nir); if (key->clamp_color) { NIR_PASS_V(state.ir.nir, nir_lower_clamp_color_outputs); @@ -1770,7 +1768,7 @@ st_get_common_variant(struct st_context *st, bool finalize = false; state.type = PIPE_SHADER_IR_NIR; - state.ir.nir = nir_shader_clone(NULL, prog->state.ir.nir); + state.ir.nir = nir_shader_clone(NULL, prog->Base.nir); if (key->clamp_color) { NIR_PASS_V(state.ir.nir, nir_lower_clamp_color_outputs);