aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glsl_types.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-10-01 23:12:13 +0200
committermarha <marha@users.sourceforge.net>2014-10-01 23:12:13 +0200
commit88236adfe3eb41b8368b4c9ecf3e09a7199dc474 (patch)
tree6acb3f7ad3c60c4605551245df9c321b5fb22c3b /mesalib/src/glsl/glsl_types.cpp
parente4086b3defb6186a2fb8a5845968c97e613fb493 (diff)
parent30eb28e89e513ba7c04e8424be0cba326a01882b (diff)
downloadvcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.tar.gz
vcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.tar.bz2
vcxsrv-88236adfe3eb41b8368b4c9ecf3e09a7199dc474.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/win.h xorg-server/hw/xwin/winclipboard/internal.h xorg-server/hw/xwin/winclipboard/thread.c xorg-server/hw/xwin/winclipboard/wndproc.c xorg-server/hw/xwin/winclipboard/xevents.c xorg-server/hw/xwin/winclipboardinit.c xorg-server/hw/xwin/winclipboardwrappers.c xorg-server/hw/xwin/winglobals.c
Diffstat (limited to 'mesalib/src/glsl/glsl_types.cpp')
-rw-r--r--mesalib/src/glsl/glsl_types.cpp34
1 files changed, 24 insertions, 10 deletions
diff --git a/mesalib/src/glsl/glsl_types.cpp b/mesalib/src/glsl/glsl_types.cpp
index 66e9b1330..c11d86482 100644
--- a/mesalib/src/glsl/glsl_types.cpp
+++ b/mesalib/src/glsl/glsl_types.cpp
@@ -490,6 +490,20 @@ 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 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;
+
for (unsigned i = 0; i < this->length; i++) {
if (this->fields.structure[i].type != b->fields.structure[i].type)
return false;
@@ -678,12 +692,17 @@ glsl_type::component_slots() const
unsigned
glsl_type::uniform_locations() const
{
- if (this->is_matrix())
- return 1;
-
unsigned size = 0;
switch (this->base_type) {
+ case GLSL_TYPE_UINT:
+ case GLSL_TYPE_INT:
+ case GLSL_TYPE_FLOAT:
+ case GLSL_TYPE_BOOL:
+ case GLSL_TYPE_SAMPLER:
+ case GLSL_TYPE_IMAGE:
+ return 1;
+
case GLSL_TYPE_STRUCT:
case GLSL_TYPE_INTERFACE:
for (unsigned i = 0; i < this->length; i++)
@@ -692,13 +711,8 @@ glsl_type::uniform_locations() const
case GLSL_TYPE_ARRAY:
return this->length * this->fields.array->uniform_locations();
default:
- break;
+ return 0;
}
-
- /* The location count for many types match with component_slots() result,
- * all expections should be handled above.
- */
- return component_slots();
}
bool
@@ -965,7 +979,7 @@ glsl_type::std140_size(bool row_major) const
if (field_type->is_record() && (i + 1 < this->length))
size = glsl_align(size, 16);
}
- size = glsl_align(size, max_align);
+ size = glsl_align(size, MAX2(max_align, 16));
return size;
}