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 <boris.brezillon@collabora.com> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28399>
This commit is contained in:

committed by
Marge Bot

parent
6672135748
commit
cfe2254149
@@ -112,14 +112,12 @@ unsigned
|
|||||||
panvk_per_arch(pipeline_layout_ubo_start)(
|
panvk_per_arch(pipeline_layout_ubo_start)(
|
||||||
const struct panvk_pipeline_layout *layout, unsigned set, bool is_dynamic)
|
const struct panvk_pipeline_layout *layout, unsigned set, bool is_dynamic)
|
||||||
{
|
{
|
||||||
const struct panvk_descriptor_set_layout *set_layout =
|
unsigned offset = PANVK_NUM_BUILTIN_UBOS;
|
||||||
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;
|
|
||||||
|
|
||||||
if (is_dynamic)
|
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;
|
return offset;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user