summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_clone.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-09-18 14:15:36 -0700
committerPaul Berry <[email protected]>2013-10-09 16:49:31 -0700
commit3f4292a6e361c03abe922e025d24cba17e0ab305 (patch)
treece1da045ef60477bc730dc361874e44396fb2026 /src/glsl/ir_clone.cpp
parent22d3ef2df1f4fd6c4a0aaf17996fdcd9b70547cb (diff)
glsl: Add an ir_variable::max_ifc_array_access field.
For interface blocks that contain arrays, this field will contain the maximum element of each contained array that is accessed by the shader. This is a first step toward supporting unsized arrays in interface blocks. Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/glsl/ir_clone.cpp')
-rw-r--r--src/glsl/ir_clone.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp
index dde22e01846..105f9063a96 100644
--- a/src/glsl/ir_clone.cpp
+++ b/src/glsl/ir_clone.cpp
@@ -44,6 +44,12 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
(ir_variable_mode) this->mode);
var->max_array_access = this->max_array_access;
+ if (this->is_interface_instance()) {
+ var->max_ifc_array_access =
+ rzalloc_array(var, unsigned, this->interface_type->length);
+ memcpy(var->max_ifc_array_access, this->max_ifc_array_access,
+ this->interface_type->length * sizeof(unsigned));
+ }
var->read_only = this->read_only;
var->centroid = this->centroid;
var->invariant = this->invariant;