aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-10-22 15:07:00 -0700
committerIan Romanick <[email protected]>2013-10-22 15:23:30 -0700
commitcf8b14ce6dc8e6c741005fa76cfda046e1618ea4 (patch)
tree2cd3f5994808fce6d7131a21e19627284d1a2978 /src
parentaf229c94e357fb4747f108603382168e49b6fd02 (diff)
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 <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/linker.cpp10
-rw-r--r--src/glsl/linker.h4
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);