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:
committed by
Marge Bot
parent
b8cc891e6e
commit
fead813644
@@ -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 <
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user