gallivm/nir: fix vulkan vertex inputs

the tgsi file max is used to determine the number of input slots,
the old code was pretty bogus for the lavapipe cases (it worked
by accident).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7416>
This commit is contained in:
Dave Airlie 2020-10-30 13:48:55 +10:00 committed by Marge Bot
parent 621c4f816f
commit 42b5cfdbd2

View file

@ -577,10 +577,18 @@ void nir_tgsi_scan_shader(const struct nir_shader *nir,
info->num_inputs = util_bitcount64(nir->info.inputs_read);
if (nir->info.inputs_read_indirectly)
info->indirect_files |= 1 << TGSI_FILE_INPUT;
info->file_max[TGSI_FILE_INPUT] = info->num_inputs - 1;
} else {
int max = -1;
nir_foreach_shader_in_variable(var, nir) {
int slots = glsl_count_attribute_slots(var->type, false);
int tmax = var->data.driver_location + slots - 1;
if (tmax > max)
max = tmax;
info->file_max[TGSI_FILE_INPUT] = max;
}
}
info->file_max[TGSI_FILE_INPUT] = info->num_inputs - 1;
i = 0;
uint64_t processed_outputs = 0;
unsigned num_outputs = 0;