From: Eric Anholt Date: Sun, 24 Feb 2019 00:17:02 +0000 (-0800) Subject: nir: Improve printing of load_input/store_output variable names. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a4f612b4cf84cb5f40ab7eda6075dff89c2b6404;p=mesa.git 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 --- 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; }