mesa: pass gl_program to _mesa_associate_uniform_storage()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 11 May 2017 09:54:09 +0000 (11:54 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 14 Jun 2017 08:04:36 +0000 (10:04 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/program/ir_to_mesa.cpp
src/mesa/program/ir_to_mesa.h
src/mesa/state_tracker/st_glsl_to_nir.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp
src/mesa/state_tracker/st_shader_cache.c

index ab39406..f6608af 100644 (file)
@@ -2529,9 +2529,11 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
 void
 _mesa_associate_uniform_storage(struct gl_context *ctx,
                                 struct gl_shader_program *shader_program,
-                                struct gl_program_parameter_list *params,
+                                struct gl_program *prog,
                                 bool propagate_to_storage)
 {
+   struct gl_program_parameter_list *params = prog->Parameters;
+
    /* After adding each uniform to the parameter list, connect the storage for
     * the parameter with the tracking structure used by the API for the
     * uniform.
@@ -2979,8 +2981,7 @@ get_mesa_program(struct gl_context *ctx,
     * prog->ParameterValues to get reallocated (e.g., anything that adds a
     * program constant) has to happen before creating this linkage.
     */
-   _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters,
-                                   true);
+   _mesa_associate_uniform_storage(ctx, shader_program, prog, true);
    if (!shader_program->data->LinkStatus) {
       goto fail_exit;
    }
index 0944619..e3d3644 100644 (file)
@@ -45,8 +45,8 @@ _mesa_generate_parameters_list_for_uniforms(struct gl_shader_program
                                            *params);
 void
 _mesa_associate_uniform_storage(struct gl_context *ctx,
-                               struct gl_shader_program *shader_program,
-                                struct gl_program_parameter_list *params,
+                                struct gl_shader_program *shader_program,
+                                struct gl_program *prog,
                                 bool propagate_to_storage);
 
 #ifdef __cplusplus
index fd5eeea..524eefa 100644 (file)
@@ -436,8 +436,7 @@ st_nir_get_mesa_program(struct gl_context *ctx,
     * prog->ParameterValues to get reallocated (e.g., anything that adds a
     * program constant) has to happen before creating this linkage.
     */
-   _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters,
-                                   true);
+   _mesa_associate_uniform_storage(ctx, shader_program, prog, true);
 
    struct st_vertex_program *stvp;
    struct st_fragment_program *stfp;
index 66f0814..f1e8ec5 100644 (file)
@@ -6828,8 +6828,7 @@ get_mesa_program_tgsi(struct gl_context *ctx,
     * prog->ParameterValues to get reallocated (e.g., anything that adds a
     * program constant) has to happen before creating this linkage.
     */
-   _mesa_associate_uniform_storage(ctx, shader_program, prog->Parameters,
-                                   true);
+   _mesa_associate_uniform_storage(ctx, shader_program, prog, true);
    if (!shader_program->data->LinkStatus) {
       free_glsl_to_tgsi_visitor(v);
       _mesa_reference_program(ctx, &shader->Program, NULL);
index 305435f..ba964eb 100644 (file)
@@ -364,8 +364,7 @@ st_load_tgsi_from_disk_cache(struct gl_context *ctx,
          }
 
          st_set_prog_affected_state_flags(glprog);
-         _mesa_associate_uniform_storage(ctx, prog, glprog->Parameters,
-                                         false);
+         _mesa_associate_uniform_storage(ctx, prog, glprog, false);
 
          /* Create Gallium shaders now instead of on demand. */
          if (ST_DEBUG & DEBUG_PRECOMPILE ||