summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ir_array_refcount.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-12-13 20:29:23 -0800
committerIan Romanick <[email protected]>2016-12-19 15:55:43 -0800
commitb7053b80f27091acc8ccc954db99197e3073bff4 (patch)
tree61b6634203e84c4a2738d24ae5eb290d7973e5a2 /src/compiler/glsl/ir_array_refcount.cpp
parent5085b640313f806150729a197c438a0cfea35f49 (diff)
glsl: Add tracking for elements of an array-of-arrays that have been accessed
If there's a better way to provide access to ir_array_refcount_entry private members to the test functions, I am very interested to know about it. Signed-off-by: Ian Romanick <[email protected]> Cc: Francisco Jerez <[email protected]> Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_array_refcount.cpp')
-rw-r--r--src/compiler/glsl/ir_array_refcount.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/glsl/ir_array_refcount.cpp b/src/compiler/glsl/ir_array_refcount.cpp
index b997d415d1d..36b22742fa8 100644
--- a/src/compiler/glsl/ir_array_refcount.cpp
+++ b/src/compiler/glsl/ir_array_refcount.cpp
@@ -56,7 +56,15 @@ ir_array_refcount_visitor::~ir_array_refcount_visitor()
ir_array_refcount_entry::ir_array_refcount_entry(ir_variable *var)
: var(var), is_referenced(false)
{
- /* empty */
+ num_bits = MAX2(1, var->type->arrays_of_arrays_size());
+ bits = new BITSET_WORD[BITSET_WORDS(num_bits)];
+ memset(bits, 0, BITSET_WORDS(num_bits) * sizeof(bits[0]));
+}
+
+
+ir_array_refcount_entry::~ir_array_refcount_entry()
+{
+ delete [] bits;
}