From 875d4fe6f2b2a5ced7cf8fec1826dac6f5a7bf60 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 16 Aug 2022 15:27:47 +1000 Subject: [PATCH] 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: --- src/nouveau/vulkan/nvk_shader.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/nouveau/vulkan/nvk_shader.c b/src/nouveau/vulkan/nvk_shader.c index 70c2e76858a..e5843db7339 100644 --- a/src/nouveau/vulkan/nvk_shader.c +++ b/src/nouveau/vulkan/nvk_shader.c @@ -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); }