Mesa (master): glsl: Add error message for intrastage interface block mismatch.

Paul Berry stereotype441 at kemper.freedesktop.org
Tue Jul 30 17:13:29 UTC 2013


Module: Mesa
Branch: master
Commit: 659ec1c958b59b77b5334d1121722ea0c80dddf8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=659ec1c958b59b77b5334d1121722ea0c80dddf8

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Sat Jul 27 14:58:43 2013 -0700

glsl: Add error message for intrastage interface block mismatch.

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 at intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/link_interface_blocks.cpp |    5 ++++-
 src/glsl/linker.cpp                |    3 ++-
 src/glsl/linker.h                  |    3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/glsl/link_interface_blocks.cpp b/src/glsl/link_interface_blocks.cpp
index b91860d..4f67291 100644
--- a/src/glsl/link_interface_blocks.cpp
+++ b/src/glsl/link_interface_blocks.cpp
@@ -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;
          }
       }
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index 4ffd40e..3d9c59d 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -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;
 
diff --git a/src/glsl/linker.h b/src/glsl/linker.h
index 85a6817..9f5deb5 100644
--- a/src/glsl/linker.h
+++ b/src/glsl/linker.h
@@ -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




More information about the mesa-commit mailing list