The Vulkan specification says: "If VkDescriptorSetAllocateInfo::pSetLayouts[i]
does not include a variable count descriptor binding, then
pDescriptorCounts[i] is ignored". The previous code triggered an assertion
in such cases, and this patch fixes it.
v2: removed the offending assertion that is now always satisfied and
reworded the commit message with a reference to Vulkan spec.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4992
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11576>
set->header.buffer_count = buffer_count;
uint32_t layout_size = layout->size;
if (variable_count) {
- assert(layout->has_variable_descriptors);
uint32_t stride = layout->binding[layout->binding_count - 1].size;
if (layout->binding[layout->binding_count - 1].type ==
VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT)
RADV_FROM_HANDLE(radv_descriptor_set_layout, layout, pAllocateInfo->pSetLayouts[i]);
const uint32_t *variable_count = NULL;
- if (variable_counts) {
+ if (layout->has_variable_descriptors && variable_counts) {
if (i < variable_counts->descriptorSetCount)
variable_count = variable_counts->pDescriptorCounts + i;
else