From: Marek Olšák Date: Tue, 25 Aug 2020 23:27:26 +0000 (-0400) Subject: st/mesa: remove useless code for lowered IO in st_nir_assign_vs_in_locations X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=003ea78b774b82dd93948d226d4fd4d9a19ccae0;p=mesa.git st/mesa: remove useless code for lowered IO in st_nir_assign_vs_in_locations It's not needed. Reviewed-by: Connor Abbott Part-of: --- diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 442f1ffeeb8..12e711936ea 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -102,37 +102,11 @@ st_shader_gather_info(nir_shader *nir, struct gl_program *prog) void st_nir_assign_vs_in_locations(struct nir_shader *nir) { - if (nir->info.stage != MESA_SHADER_VERTEX) + if (nir->info.stage != MESA_SHADER_VERTEX || nir->info.io_lowered) return; nir->num_inputs = util_bitcount64(nir->info.inputs_read); - if (nir->info.io_lowered) { - /* Adjust the locations in load_input intrinsics. */ - nir_foreach_function(f, nir) { - if (f->impl) { - nir_foreach_block(block, f->impl) { - nir_foreach_instr_safe(instr, block) { - if (instr->type == nir_instr_type_intrinsic) { - nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); - - if (intrin->intrinsic == nir_intrinsic_load_input) { - unsigned base = nir_intrinsic_base(intrin); - unsigned loc = nir_intrinsic_io_semantics(intrin).location; - - assert(nir->info.inputs_read & BITFIELD64_BIT(loc)); - base = util_bitcount64(nir->info.inputs_read & - BITFIELD64_MASK(loc)); - nir_intrinsic_set_base(intrin, base); - } - } - } - } - } - } - return; - } - bool removed_inputs = false; nir_foreach_shader_in_variable_safe(var, nir) {