From cfe22541498a9519b848f85e79a4e118b38a19e4 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 30 Jan 2024 13:27:44 +0100 Subject: [PATCH] panvk: Put dynamic uniform buffers at the end of the UBO array It's easier to reason about if dynamic uniform buffers (which have a per-pipeline limit, and are cached at the command buffer level) are placed at the end of the UBO array. It will also allow us to do a memcpy instead of iterating over all sets to collect these dynamic UBOs. Signed-off-by: Boris Brezillon Reviewed-by: Mary Guillemard Part-of: --- src/panfrost/vulkan/panvk_vX_pipeline_layout.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/panfrost/vulkan/panvk_vX_pipeline_layout.c b/src/panfrost/vulkan/panvk_vX_pipeline_layout.c index 70296ef6a6d..1bc66a6a12c 100644 --- a/src/panfrost/vulkan/panvk_vX_pipeline_layout.c +++ b/src/panfrost/vulkan/panvk_vX_pipeline_layout.c @@ -112,14 +112,12 @@ unsigned panvk_per_arch(pipeline_layout_ubo_start)( const struct panvk_pipeline_layout *layout, unsigned set, bool is_dynamic) { - const struct panvk_descriptor_set_layout *set_layout = - vk_to_panvk_descriptor_set_layout(layout->vk.set_layouts[set]); - - unsigned offset = PANVK_NUM_BUILTIN_UBOS + layout->sets[set].ubo_offset + - layout->sets[set].dyn_ubo_offset; + unsigned offset = PANVK_NUM_BUILTIN_UBOS; if (is_dynamic) - offset += set_layout->num_ubos; + offset += layout->num_ubos + layout->sets[set].dyn_ubo_offset; + else + offset += layout->sets[set].ubo_offset; return offset; }