From f47d0829cbee59e54ceb7f25ccea31bc78d5b8e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Pi=C3=B1eiro?= Date: Thu, 26 Mar 2020 16:30:20 +0100 Subject: [PATCH] v3dv/pipeline: fix adding texture/samplers array elements to texture/sampler map For arrays we are adding one entry on the map per array element. This makes getting back the descriptor for each array element easier, as for example, for ubo arrays, each array element can be bound to a different descriptor buffer. For samplers arrays this would also make sense. Fixes crashes on tests like: dEQP-VK.binding_model.shader_access.primary_cmd_buf.combined_image_sampler_mutable.fragment.descriptor_array.2d Part-of: --- src/broadcom/vulkan/v3dv_pipeline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index 4e8dcea..ff74cc2 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -553,8 +553,8 @@ lower_tex_src_to_offset(nir_builder *b, nir_tex_instr *instr, unsigned src_idx, &pipeline->sampler_map : &pipeline->texture_map, deref->var->data.descriptor_set, deref->var->data.binding, - deref->var->data.index, - binding_layout->array_size) + base_index; + deref->var->data.index + base_index, + binding_layout->array_size); if (is_sampler) instr->sampler_index = desc_index; else -- 2.7.4