From 48bf9c736f92e22791e24f1c202020179ff7e790 Mon Sep 17 00:00:00 2001 From: Karmjit Mahil Date: Thu, 4 May 2023 15:25:40 +0100 Subject: pvr: Use original binding numbers instead of reassigning Previously, in the descriptor set layout, if there were gaps within the binding numbers, the code would remove the gap and assign a sequential binding number to each. This is causes problems when looking up the binding on a vkUpdateDescriptorSets() as the user would still be providing the original binding numbers. If gaps were removed and binding number re-assigned, the binding could either not be found, or a different binding was found instead of the desired one. Let's not re-assign binding numbers and just use the original ones. This fixes the following assert being hit: `pvr_descriptor_set.c:1890: pvr_write_descriptor_set: Assertion `binding' failed.` on dEQP tests such as: dEQP-VK.glsl.opaque_type_indexing.ubo.uniform_vertex dEQP-VK.glsl.opaque_type_indexing.ubo.uniform_fragment ... Signed-off-by: Karmjit Mahil Reviewed-by: Frank Binns Part-of: --- src/imagination/vulkan/pvr_common.h | 3 +-- src/imagination/vulkan/pvr_descriptor_set.c | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/imagination/vulkan/pvr_common.h b/src/imagination/vulkan/pvr_common.h index a6d509dd586..13395386b01 100644 --- a/src/imagination/vulkan/pvr_common.h +++ b/src/imagination/vulkan/pvr_common.h @@ -267,8 +267,7 @@ struct pvr_descriptor_set_layout_binding { VkDescriptorType type; /* "M" in layout(set = N, binding = M) - * Can be used to index bindings in the descriptor_set_layout. Not the - * original user specified binding number as those might be non-contiguous. + * Can be used to index bindings in the descriptor_set_layout. */ uint32_t binding_number; diff --git a/src/imagination/vulkan/pvr_descriptor_set.c b/src/imagination/vulkan/pvr_descriptor_set.c index 1855876839c..fede093b44c 100644 --- a/src/imagination/vulkan/pvr_descriptor_set.c +++ b/src/imagination/vulkan/pvr_descriptor_set.c @@ -511,10 +511,7 @@ VkResult pvr_CreateDescriptorSetLayout( uint8_t shader_stages = 0; internal_binding->type = binding->descriptorType; - /* The binding_numbers can be non-contiguous so we ignore the user - * specified binding numbers and make them contiguous ourselves. - */ - internal_binding->binding_number = bind_num; + internal_binding->binding_number = binding->binding; /* From Vulkan spec 1.2.189: * -- cgit v1.2.1