[Mesa-dev] [RFC PATCH 20/65] mesa: pass gl_program to _mesa_associate_uniform_storage()
Samuel Pitoiset
samuel.pitoiset at gmail.com
Fri May 19 16:52:25 UTC 2017
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/mesa/program/ir_to_mesa.cpp | 7 ++++---
src/mesa/program/ir_to_mesa.h | 4 ++--
src/mesa/state_tracker/st_glsl_to_nir.cpp | 3 +--
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 3 +--
src/mesa/state_tracker/st_shader_cache.c | 3 +--
5 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index 8ed249f8ca..5e6304036d 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -2537,9 +2537,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.
@@ -2987,8 +2989,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;
}
diff --git a/src/mesa/program/ir_to_mesa.h b/src/mesa/program/ir_to_mesa.h
index 09446197b2..e3d364455c 100644
--- a/src/mesa/program/ir_to_mesa.h
+++ b/src/mesa/program/ir_to_mesa.h
@@ -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
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index fd5eeea0f9..524eefa236 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -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;
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 76cd4dc3a5..7571e7d495 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6805,8 +6805,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);
diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c
index 23416c0c3f..068b4e20bb 100644
--- a/src/mesa/state_tracker/st_shader_cache.c
+++ b/src/mesa/state_tracker/st_shader_cache.c
@@ -360,8 +360,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);
free(buffer);
} else {
--
2.13.0
More information about the mesa-dev
mailing list