summaryrefslogtreecommitdiffstats
path: root/src/glsl/link_varyings.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-02-14 12:10:27 -0800
committerIan Romanick <[email protected]>2014-05-02 07:19:40 -0700
commit1ff5a2b1ba2148b772f5e5c86d64c3cb18e1ce97 (patch)
tree4e931f34056d30b8ffbecb9d6b05ea4d3453fd57 /src/glsl/link_varyings.cpp
parent7d73c3e99ec14031e3834096f7e8e257338b64d4 (diff)
linker: Assign varying locations for separable programs
Signed-off-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r--src/glsl/link_varyings.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
index 898233205eb..85a8b90d7d6 100644
--- a/src/glsl/link_varyings.cpp
+++ b/src/glsl/link_varyings.cpp
@@ -1198,6 +1198,23 @@ assign_varying_locations(struct gl_context *ctx,
matches.record(output_var, input_var);
}
}
+ } else {
+ /* If there's no producer stage, then this must be a separable program.
+ * For example, we may have a program that has just a fragment shader.
+ * Later this program will be used with some arbitrary vertex (or
+ * geometry) shader program. This means that locations must be assigned
+ * for all the inputs.
+ */
+ foreach_list(node, consumer->ir) {
+ ir_variable *const input_var =
+ ((ir_instruction *) node)->as_variable();
+
+ if ((input_var == NULL) ||
+ (input_var->data.mode != ir_var_shader_in))
+ continue;
+
+ matches.record(NULL, input_var);
+ }
}
for (unsigned i = 0; i < num_tfeedback_decls; ++i) {