summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glsl/linker.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index a6e81b41f3c..acc63ae8cf6 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -3433,7 +3433,7 @@ add_interface_variables(struct gl_shader_program *shProg,
}
static bool
-add_packed_varyings(struct gl_shader_program *shProg, int stage)
+add_packed_varyings(struct gl_shader_program *shProg, int stage, GLenum type)
{
struct gl_shader *sh = shProg->_LinkedShaders[stage];
GLenum iface;
@@ -3454,10 +3454,13 @@ add_packed_varyings(struct gl_shader_program *shProg, int stage)
default:
unreachable("unexpected type");
}
- if (!add_program_resource(shProg, iface, var,
- build_stageref(shProg, var->name,
- var->data.mode)))
- return false;
+
+ if (type == iface) {
+ if (!add_program_resource(shProg, iface, var,
+ build_stageref(shProg, var->name,
+ var->data.mode)))
+ return false;
+ }
}
}
return true;
@@ -3724,9 +3727,9 @@ build_program_resource_list(struct gl_shader_program *shProg)
/* Program interface needs to expose varyings in case of SSO. */
if (shProg->SeparateShader) {
- if (!add_packed_varyings(shProg, input_stage))
+ if (!add_packed_varyings(shProg, input_stage, GL_PROGRAM_INPUT))
return;
- if (!add_packed_varyings(shProg, output_stage))
+ if (!add_packed_varyings(shProg, output_stage, GL_PROGRAM_OUTPUT))
return;
}