diff options
author | Timothy Arceri <[email protected]> | 2016-10-19 14:49:48 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-10-26 14:29:36 +1100 |
commit | e40d32b3ec0793b475004b8f36b17f1493806271 (patch) | |
tree | 7064257c277e14a14e8c261973581efd8b827180 /src/mesa/state_tracker | |
parent | 68db0fe0346386c8d231eb81da6340b24b7878b0 (diff) |
mesa: modify _mesa_copy_linked_program_data() to take gl_linked_shader
This allows us to do some small tidy ups, but will also allow us to call
a new function that copies values to a shared shader info from here.
In order to make this change this function now requires
_mesa_reference_program() to have previously been called.
Reviewed-by: Jason Ekstrand <[email protected]>
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. |