mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 20:10:14 +01:00
glsl: Match unnamed record types across stages.
Unnamed record types are assigned to separate types per stage, e.g. if
uniform struct { ... } a;
is defined in both vertex and fragment shader, two separate types will
result with different names. When linking the shader, this results in a
type conflict. However, there is no reason why this should not be
allowed according to GLSL specifications. Compare and match record types
when linking shader stages to avoid this conflict.
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
41c9bf884f
commit
955c93dc08
1 changed files with 4 additions and 0 deletions
|
|
@ -609,6 +609,10 @@ cross_validate_globals(struct gl_shader_program *prog,
|
||||||
if (var->type->length != 0) {
|
if (var->type->length != 0) {
|
||||||
existing->type = var->type;
|
existing->type = var->type;
|
||||||
}
|
}
|
||||||
|
} else if (var->type->is_record()
|
||||||
|
&& existing->type->is_record()
|
||||||
|
&& existing->type->record_compare(var->type)) {
|
||||||
|
existing->type = var->type;
|
||||||
} else {
|
} else {
|
||||||
linker_error(prog, "%s `%s' declared as type "
|
linker_error(prog, "%s `%s' declared as type "
|
||||||
"`%s' and type `%s'\n",
|
"`%s' and type `%s'\n",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue