[Mesa-dev] [PATCH v2 10/15] glsl linker: cross validate interface block types between stages
Jordan Justen
jordan.l.justen at intel.com
Mon Mar 18 16:35:07 PDT 2013
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
src/glsl/linker.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 29856b0..acbdd2f 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -478,6 +478,7 @@ cross_validate_globals(struct gl_shader_program *prog,
* them.
*/
glsl_symbol_table variables;
+ glsl_symbol_table interfaces;
for (unsigned i = 0; i < num_shaders; i++) {
if (shader_list[i] == NULL)
continue;
@@ -488,6 +489,18 @@ cross_validate_globals(struct gl_shader_program *prog,
if (var == NULL)
continue;
+ if (var->is_in_uniform_block()) {
+ const glsl_type *type = interfaces.get_type(var->interface_type->name);
+ if (type == NULL) {
+ interfaces.add_type(var->interface_type->name, var->interface_type);
+ } else if (type != var->interface_type) {
+ linker_error(prog, "interface block `%s' is inconsistent "
+ "between shader stages\n",
+ type->name);
+ return false;
+ }
+ }
+
if (uniforms_only && (var->mode != ir_var_uniform))
continue;
--
1.7.10.4
More information about the mesa-dev
mailing list