diff options
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_nir.cpp | 6 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index f43460ba67a..97fef082c04 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -378,9 +378,11 @@ st_nir_get_mesa_program(struct gl_context *ctx, if (!prog) return NULL; + _mesa_reference_program(ctx, &shader->Program, prog); + prog->Parameters = _mesa_new_parameter_list(); - _mesa_copy_linked_program_data(shader->Stage, shader_program, prog); + _mesa_copy_linked_program_data(shader_program, shader); _mesa_generate_parameters_list_for_uniforms(shader_program, shader, prog->Parameters); @@ -426,8 +428,6 @@ st_nir_get_mesa_program(struct gl_context *ctx, prog->ExternalSamplersUsed = gl_external_samplers(shader); _mesa_update_shader_textures_used(shader_program, prog); - _mesa_reference_program(ctx, &shader->Program, prog); - /* Avoid reallocation of the program parameter list, because the uniform * storage is only associated with the original parameter list. * This should be enough for Bitmap and DrawPixels constants. diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index f3764623d50..b2bd2152488 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -6379,6 +6379,9 @@ get_mesa_program_tgsi(struct gl_context *ctx, prog = ctx->Driver.NewProgram(ctx, target, shader_program->Name); if (!prog) return NULL; + + _mesa_reference_program(ctx, &shader->Program, prog); + prog->Parameters = _mesa_new_parameter_list(); v = new glsl_to_tgsi_visitor(); v->ctx = ctx; @@ -6394,7 +6397,7 @@ get_mesa_program_tgsi(struct gl_context *ctx, v->have_fma = pscreen->get_shader_param(pscreen, ptarget, PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED); - _mesa_copy_linked_program_data(shader->Stage, shader_program, prog); + _mesa_copy_linked_program_data(shader_program, shader); _mesa_generate_parameters_list_for_uniforms(shader_program, shader, prog->Parameters); @@ -6486,8 +6489,6 @@ get_mesa_program_tgsi(struct gl_context *ctx, wposTransformState); } - _mesa_reference_program(ctx, &shader->Program, prog); - /* Avoid reallocation of the program parameter list, because the uniform * storage is only associated with the original parameter list. * This should be enough for Bitmap and DrawPixels constants. |