vulkan/runtime: store index of the push descriptor in pipeline layout

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34874>
This commit is contained in:
Lionel Landwerlin
2024-08-05 21:43:05 +03:00
committed by Marge Bot
parent b8cc891e6e
commit fead813644
2 changed files with 12 additions and 2 deletions
+9 -2
View File
@@ -44,16 +44,23 @@ vk_pipeline_layout_init(struct vk_device *device,
layout->ref_cnt = 1;
layout->create_flags = pCreateInfo->flags;
layout->set_count = pCreateInfo->setLayoutCount;
layout->push_descriptor_idx = UINT32_MAX;
layout->destroy = vk_pipeline_layout_destroy;
for (uint32_t s = 0; s < pCreateInfo->setLayoutCount; s++) {
VK_FROM_HANDLE(vk_descriptor_set_layout, set_layout,
pCreateInfo->pSetLayouts[s]);
if (set_layout != NULL)
if (set_layout != NULL) {
layout->set_layouts[s] = vk_descriptor_set_layout_ref(set_layout);
else
if (set_layout->flags &
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR) {
assert(layout->push_descriptor_idx == UINT32_MAX);
layout->push_descriptor_idx = s;
}
} else {
layout->set_layouts[s] = NULL;
}
}
assert(pCreateInfo->pushConstantRangeCount <
+3
View File
@@ -59,6 +59,9 @@ struct vk_pipeline_layout {
/** Number of descriptor set layouts in this pipeline layout */
uint32_t set_count;
/** Push descriptor index or UINT32_MAX if not present */
uint32_t push_descriptor_idx;
/** Array of pointers to descriptor set layouts, indexed by set index */
struct vk_descriptor_set_layout *set_layouts[MESA_VK_MAX_DESCRIPTOR_SETS];