From bdaa825087f9732c0ca1a75c360c1cd3e079a2cc Mon Sep 17 00:00:00 2001 From: Kalyan Kondapally Date: Mon, 15 Sep 2014 22:48:37 -0700 Subject: [PATCH] Structures must have same name to be considered same type. According to GLSL(4.2) and GLSL-ES (1.0, 3.0) spec, Structures must have the same name to be considered same type. We currently ignore the name check while checking if two records are same. This patch fixes this. Signed-off-by: Kalyan Kondapally --- src/glsl/glsl_types.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp index 66e9b13..a2e5d37 100644 --- a/src/glsl/glsl_types.cpp +++ b/src/glsl/glsl_types.cpp @@ -489,6 +489,14 @@ glsl_type::record_compare(const glsl_type *b) const if (this->interface_packing != b->interface_packing) return false; + /* From the GLSL 4.20 specification: (Sec 4.2) + * "Structures must have the same name, sequence of type + * names, and type definitions, and field names to be + * considered the same type. " + * GLSL-ES is also same(Ver 1.00 Sec 4.2.4, Ver 3.00 Sec 4.2.5). + */ + 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) -- 1.7.9.5