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 <ian.d.romanick@intel.com>
Cc: Francisco Jerez <currojerez@riseup.net>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Ian Romanick
2016-12-13 20:29:23 -08:00
parent 5085b64031
commit b7053b80f2
4 changed files with 177 additions and 1 deletions
+9 -1
View File
@@ -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;
}