diff options
author | Jason Ekstrand <[email protected]> | 2014-11-19 12:53:08 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-01-15 07:19:02 -0800 |
commit | b5143edaeeb6f57558f5bb6fbd7f7cc39ad7489d (patch) | |
tree | 8362d1cbab931746f1cbe2095bceae6d74f0da5a /src/glsl/nir/nir_print.c | |
parent | 8219ff1796ab18d19fe9cf3cf93f463a984e2c80 (diff) |
nir: Make array deref direct vs. indirect an enum
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir_print.c')
-rw-r--r-- | src/glsl/nir/nir_print.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c index 2ae31ef9bc9..0156582c20c 100644 --- a/src/glsl/nir/nir_print.c +++ b/src/glsl/nir/nir_print.c @@ -265,12 +265,15 @@ static void print_deref_array(nir_deref_array *deref, print_var_state *state, FILE *fp) { fprintf(fp, "["); - if (!deref->has_indirect || deref->base_offset != 0) + switch (deref->deref_array_type) { + case nir_deref_array_type_direct: fprintf(fp, "%u", deref->base_offset); - if (deref->has_indirect) { + break; + case nir_deref_array_type_indirect: if (deref->base_offset != 0) - fprintf(fp, " + "); + fprintf(fp, "%u + ", deref->base_offset); print_src(&deref->indirect, fp); + break; } fprintf(fp, "]"); } |