summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-05-14 20:03:10 +0200
committerNicolai Hähnle <[email protected]>2017-06-13 09:35:40 +0200
commit835b1435f22dda28c6d9309eef13010f4db54381 (patch)
treefacf533faa594b13ddca544a82b9f3e15bd791e3 /src/compiler
parent77ea2ada5ae4b72c43598f3faa518526cb36b822 (diff)
glsl: stop considering unnamed and named structures equal
Previously, if an unnamed and a named struct contained the same fields, they were considered the same type during linking of globals. The discussion around commit e018ea81bf58 ("glsl: Structures must have same name to be considered same type.") doesn't seem to have considered this thoroughly, and I see no evidence that an unnamed struct should ever be considered to be the same type as a named struct. Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl_types.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/compiler/glsl_types.cpp b/src/compiler/glsl_types.cpp
index 063d3f1edc2..188b72f345a 100644
--- a/src/compiler/glsl_types.cpp
+++ b/src/compiler/glsl_types.cpp
@@ -927,13 +927,9 @@ glsl_type::record_compare(const glsl_type *b, bool match_locations) const
* type definitions, and field names to be considered the same type."
*
* GLSL ES behaves the same (Ver 1.00 Sec 4.2.4, Ver 3.00 Sec 4.2.5).
- *
- * Note that we cannot force type name check when comparing unnamed
- * structure types, these have a unique name assigned during parsing.
*/
- if (!this->is_anonymous() && !b->is_anonymous())
- if (strcmp(this->name, b->name) != 0)
- return false;
+ if (strcmp(this->name, b->name) != 0)
+ return false;
for (unsigned i = 0; i < this->length; i++) {
if (this->fields.structure[i].type != b->fields.structure[i].type)