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@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Paul Berry
2013-07-27 14:58:43 -07:00
parent 4682b9b7bf
commit 659ec1c958
3 changed files with 8 additions and 3 deletions

View File

@@ -32,7 +32,8 @@
#include "main/macros.h" #include "main/macros.h"
bool 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) unsigned num_shaders)
{ {
glsl_symbol_table interfaces; 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, interfaces.add_interface(iface_type->name, iface_type,
(enum ir_variable_mode) var->mode); (enum ir_variable_mode) var->mode);
} else if (old_iface_type != iface_type) { } else if (old_iface_type != iface_type) {
linker_error(prog, "definitions of interface block `%s' do not"
" match\n", iface_type->name);
return false; return false;
} }
} }

View File

@@ -960,7 +960,8 @@ link_intrastage_shaders(void *mem_ctx,
/* Check that interface blocks defined in multiple shaders are consistent. /* 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)) num_shaders))
return NULL; return NULL;

View File

@@ -61,7 +61,8 @@ link_uniform_blocks(void *mem_ctx,
struct gl_uniform_block **blocks_ret); struct gl_uniform_block **blocks_ret);
bool 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); unsigned num_shaders);
bool bool