diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index 4becf8a207f..d5f335b6a0e 100644 --- a/src/compiler/nir/nir_linking_helpers.c +++ b/src/compiler/nir/nir_linking_helpers.c @@ -120,11 +120,6 @@ tcs_add_output_reads(nir_shader *shader, uint64_t *read, uint64_t *patches_read) * progress = nir_remove_unused_io_vars(producer, nir_var_shader_out, * read, patches_read) || * progress; - * - * The "used" should be an array of 4 uint64_ts (probably of VARYING_BIT_*) - * representing each .location_frac used. Note that for vector variables, - * only the first channel (.location_frac) is examined for deciding if the - * variable is used! */ bool nir_remove_unused_io_vars(nir_shader *shader, @@ -153,7 +148,9 @@ nir_remove_unused_io_vars(nir_shader *shader, if (var->data.explicit_xfb_buffer) continue; - uint64_t other_stage = used[var->data.location_frac]; + uint64_t other_stage = 0; + for (unsigned i = 0; i < get_num_components(var); i++) + other_stage |= used[var->data.location_frac + i]; if (!(other_stage & get_variable_io_mask(var, shader->info.stage))) { /* This one is invalid, make it a global variable instead */