From cf8b14ce6dc8e6c741005fa76cfda046e1618ea4 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 22 Oct 2013 15:07:00 -0700 Subject: [PATCH] glsl: Modify interface to link_invalidate_variable_locations This will make it easier to unit test this function in successive patches. Also, correct the prototype in linker.h. It was... wrong. v2: Split the interface change from adding the unit tests. Suggested by Paul. Signed-off-by: Ian Romanick Reviewed-by: Paul Berry --- src/glsl/linker.cpp | 10 +++++----- src/glsl/linker.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 0a949b46699..bf96d606488 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -366,10 +366,10 @@ parse_program_resource_name(const GLchar *name, void -link_invalidate_variable_locations(gl_shader *sh, int input_base, +link_invalidate_variable_locations(exec_list *ir, int input_base, int output_base) { - foreach_list(node, sh->ir) { + foreach_list(node, ir) { ir_variable *const var = ((ir_instruction *) node)->as_variable(); if (var == NULL) @@ -2217,17 +2217,17 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) /* Mark all generic shader inputs and outputs as unpaired. */ if (prog->_LinkedShaders[MESA_SHADER_VERTEX] != NULL) { link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_VERTEX], + prog->_LinkedShaders[MESA_SHADER_VERTEX]->ir, VERT_ATTRIB_GENERIC0, VARYING_SLOT_VAR0); } if (prog->_LinkedShaders[MESA_SHADER_GEOMETRY] != NULL) { link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_GEOMETRY], + prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->ir, VARYING_SLOT_VAR0, VARYING_SLOT_VAR0); } if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) { link_invalidate_variable_locations( - prog->_LinkedShaders[MESA_SHADER_FRAGMENT], + prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->ir, VARYING_SLOT_VAR0, FRAG_RESULT_DATA0); } diff --git a/src/glsl/linker.h b/src/glsl/linker.h index 8a0027d2bca..9915c38b01e 100644 --- a/src/glsl/linker.h +++ b/src/glsl/linker.h @@ -31,8 +31,8 @@ link_function_calls(gl_shader_program *prog, gl_shader *main, gl_shader **shader_list, unsigned num_shaders); extern void -link_invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode, - int generic_base); +link_invalidate_variable_locations(exec_list *ir, int input_base, + int output_base); extern void link_assign_uniform_locations(struct gl_shader_program *prog); -- 2.30.2