glsl: Add error message for intrastage interface block mismatch.
authorPaul Berry <stereotype441@gmail.com>
Sat, 27 Jul 2013 21:58:43 +0000 (14:58 -0700)
committerPaul Berry <stereotype441@gmail.com>
Tue, 30 Jul 2013 17:10:26 +0000 (10:10 -0700)
Previously we failed to link (which is correct), but we did not output
an error message, which could have been confusing for users.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/link_interface_blocks.cpp
src/glsl/linker.cpp
src/glsl/linker.h

index b91860d039453502b0e1b82f8a70a4de7066104a..4f67291d85fd32a9a73cfe2651fa21fcbde18dfd 100644 (file)
@@ -32,7 +32,8 @@
 #include "main/macros.h"
 
 bool
-validate_intrastage_interface_blocks(const gl_shader **shader_list,
+validate_intrastage_interface_blocks(struct gl_shader_program *prog,
+                                     const gl_shader **shader_list,
                                      unsigned num_shaders)
 {
    glsl_symbol_table interfaces;
@@ -62,6 +63,8 @@ validate_intrastage_interface_blocks(const gl_shader **shader_list,
             interfaces.add_interface(iface_type->name, iface_type,
                                      (enum ir_variable_mode) var->mode);
          } else if (old_iface_type != iface_type) {
+            linker_error(prog, "definitions of interface block `%s' do not"
+                         " match\n", iface_type->name);
             return false;
          }
       }
index 4ffd40e6527e90aab470da724a5bcf12b3daf6e2..3d9c59d5de313ff2cca163e435ac200c9e1065a9 100644 (file)
@@ -960,7 +960,8 @@ link_intrastage_shaders(void *mem_ctx,
 
    /* Check that interface blocks defined in multiple shaders are consistent.
     */
-   if (!validate_intrastage_interface_blocks((const gl_shader **)shader_list,
+   if (!validate_intrastage_interface_blocks(prog,
+                                             (const gl_shader **)shader_list,
                                              num_shaders))
       return NULL;
 
index 85a6817d98d147a458d75f3cc21e46ae8b875ab4..9f5deb5c08fddc4d87f855770c624fe13ab0ff33 100644 (file)
@@ -61,7 +61,8 @@ link_uniform_blocks(void *mem_ctx,
                     struct gl_uniform_block **blocks_ret);
 
 bool
-validate_intrastage_interface_blocks(const gl_shader **shader_list,
+validate_intrastage_interface_blocks(struct gl_shader_program *prog,
+                                     const gl_shader **shader_list,
                                      unsigned num_shaders);
 
 bool