[Mesa-dev] [PATCH 07/16] nir/print: add type names for deref instr

Rob Clark robdclark at gmail.com
Sat Apr 7 16:13:39 UTC 2018


It was only shown in deref_cast instructions.  But it makes things
easier to follow to show the intermediate types in deref_array/
deref_struct instructions too.

Signed-off-by: Rob Clark <robdclark at gmail.com>
---
 src/compiler/nir/nir_print.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 7d7542a4113..5cec6a49963 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -504,9 +504,10 @@ print_deref_instr(nir_deref_instr *instr, print_state *state)
       return;
    }
 
-   fprintf(fp, " = deref_%s (%s) &",
+   fprintf(fp, " = deref_%s (%s) (%s *)&",
           (instr->deref_type == nir_deref_type_struct) ? "struct" : "array",
-          get_variable_mode_str(instr->mode));
+          get_variable_mode_str(instr->mode),
+          glsl_get_type_name(instr->type));
    print_src(&instr->parent, state);
 
    assert(instr->parent.is_ssa);
-- 
2.14.3



More information about the mesa-dev mailing list