From a4f612b4cf84cb5f40ab7eda6075dff89c2b6404 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 23 Feb 2019 16:17:02 -0800 Subject: nir: Improve printing of load_input/store_output variable names. We were printing only when the channel was exactly the start channel, so scalarized loads/stores would be missing the name on the rest. Reviewed-by: Ian Romanick --- src/compiler/nir/nir_print.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 80bc25fde9a..6b270394f9d 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -850,8 +850,10 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state) nir_foreach_variable(var, var_list) { if ((var->data.driver_location == nir_intrinsic_base(instr)) && (instr->intrinsic == nir_intrinsic_load_uniform || - var->data.location_frac == nir_intrinsic_component(instr)) && - var->name) { + (nir_intrinsic_component(instr) >= var->data.location_frac && + nir_intrinsic_component(instr) < + (var->data.location_frac + glsl_get_components(var->type)))) && + var->name) { fprintf(fp, "\t/* %s */", var->name); break; } -- cgit v1.2.3