summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-11-19 12:53:08 -0800
committerJason Ekstrand <[email protected]>2015-01-15 07:19:02 -0800
commitb5143edaeeb6f57558f5bb6fbd7f7cc39ad7489d (patch)
tree8362d1cbab931746f1cbe2095bceae6d74f0da5a /src/glsl/nir/nir.c
parent8219ff1796ab18d19fe9cf3cf93f463a984e2c80 (diff)
nir: Make array deref direct vs. indirect an enum
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.c')
-rw-r--r--src/glsl/nir/nir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index f63248ec4f1..0514158bbde 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -522,7 +522,7 @@ nir_deref_array_create(void *mem_ctx)
nir_deref_array *deref = ralloc(mem_ctx, nir_deref_array);
deref->deref.deref_type = nir_deref_type_array;
deref->deref.child = NULL;
- deref->has_indirect = false;
+ deref->deref_array_type = nir_deref_array_type_direct;
src_init(&deref->indirect);
deref->base_offset = 0;
return deref;
@@ -553,9 +553,9 @@ copy_deref_array(void *mem_ctx, nir_deref_array *deref)
{
nir_deref_array *ret = nir_deref_array_create(mem_ctx);
ret->base_offset = deref->base_offset;
- if (deref->has_indirect) {
- ret->has_indirect = true;
- ret->indirect = deref->indirect;
+ ret->deref_array_type = deref->deref_array_type;
+ if (deref->deref_array_type == nir_deref_array_type_indirect) {
+ ret->indirect = nir_src_copy(deref->indirect, mem_ctx);
}
ret->deref.type = deref->deref.type;
if (deref->deref.child)
@@ -1477,7 +1477,7 @@ static bool
visit_deref_array_src(nir_deref_array *deref, nir_foreach_src_cb cb,
void *state)
{
- if (deref->has_indirect)
+ if (deref->deref_array_type == nir_deref_array_type_indirect)
return visit_src(&deref->indirect, cb, state);
return true;
}