summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-09-23 10:44:19 -0700
committerPaul Berry <[email protected]>2013-10-09 16:49:41 -0700
commite226669eea47e2075c1188e5c61e0ba479ff8d47 (patch)
treeb72ebabd99ae6e1cd1623dce58bb504e259e33e5 /src/glsl/ir.h
parentf878d2060c196c8130af0912ffc4493c631b1c34 (diff)
glsl/linker: Modify array_sizing_visitor to handle named interface blocks.
Unsized arrays appearing inside named interface blocks now get a proper size assigned by the array_sizing_visitor. Fixes piglit tests: - spec/glsl-1.50/execution/unsized-in-named-interface-block - spec/glsl-1.50/execution/unsized-in-named-interface-block-gs - spec/glsl-1.50/linker/unsized-in-named-interface-block - spec/glsl-1.50/linker/unsized-in-named-interface-block-gs - spec/glsl-1.50/linker/unsized-in-unnamed-interface-block-gs (*) (*) is fixed by dumb luck--support for unsized arrays in unnamed interface blocks will come in a later patch. Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index eb24d4e441d..2a0afada1ea 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -404,6 +404,22 @@ public:
}
}
+ /**
+ * Change this->interface_type on a variable that previously had a
+ * different interface_type. This is used during linking to set the size
+ * of arrays in interface blocks.
+ */
+ void change_interface_type(const struct glsl_type *type)
+ {
+ if (this->max_ifc_array_access != NULL) {
+ /* max_ifc_array_access has already been allocated, so make sure the
+ * new interface has the same number of fields as the old one.
+ */
+ assert(this->interface_type->length == type->length);
+ }
+ this->interface_type = type;
+ }
+
const glsl_type *get_interface_type() const
{
return this->interface_type;