nvk: assign vertex locations according to input attrib index

This copies what lavapipe does. is there a better plan?

Fixes
dEQP-VK.draw.renderpass.simple_draw.simple_draw_triangle_list

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Dave Airlie
2022-08-16 15:27:47 +10:00
committed by Marge Bot
parent e1b12b49e6
commit 875d4fe6f2
+10 -2
View File
@@ -138,8 +138,16 @@ count_location_slots(const struct glsl_type *type, bool bindless)
static void
assign_io_locations(nir_shader *nir)
{
nir_assign_var_locations(nir, nir_var_shader_in, &nir->num_inputs,
count_location_slots);
if (nir->info.stage != MESA_SHADER_VERTEX)
nir_assign_var_locations(nir, nir_var_shader_in, &nir->num_inputs,
count_location_slots);
else {
nir_foreach_shader_in_variable(var, nir) {
assert(var->data.location >= VERT_ATTRIB_GENERIC0);
var->data.driver_location = var->data.location - VERT_ATTRIB_GENERIC0;
}
}
nir_assign_var_locations(nir, nir_var_shader_out, &nir->num_outputs,
count_location_slots);
}