You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tracked down the issue, and it relates to exhaustion of the descriptor pool. The sample defines bindings with set_layout_binding.descriptorCount = maxDescriptorSetUpdateAfterBindSampledImages, i.e. the max. This seems excessive, but may not be an issue for other platforms that respect the VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT flag which is set by the sample.
The problem arises when actually allocating descriptor sets, i.e. when calling vkAllocateDescriptorSets() extended by the VkDescriptorSetVariableDescriptorCountAllocateInfoEXT structure. The structure properly defines the number of descriptors to be allocated (i.e. NumDescriptorsStreaming and NumDescriptorsNonUniform in two separate allocations), but MoltenVK's allocate action seems to check if there are set_layout_binding.descriptorCount resources available in the pool, which in this case is 500,000 (the max) and of course this fails since it exceeds the pool size.
I have been able to verify this and get the sample working by using NumDescriptorsStreaming in the binding definition, and by increasing the pool size to 2 x NumDescriptorsStreaming (for 2 allocation calls). However, I suspect this may violate the spirit of the sample where variable descriptor count allocations are used.
I am wondering whether MoltenVK supports the variable descriptor count flag and structure, and if so, should it instead be checking for variable_info.pDescriptorCounts resources in the pool when the variable bit is enabled and the variable descriptor count structure is present in the pNext chain of allocate_info.
I am putting this forward as a question, since I may not have this right. However, I wanted to report it here before going back to the official sample repo and offering any solutions for MoltenVK in that forum.
The text was updated successfully, but these errors were encountered:
SRSaunders
changed the title
Possible MVK defect exposed by Khronos descriptor indexing sample
Question: Does MVK support VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT?
Jun 14, 2024
The use of Metal Argument Buffers in MoltenVK is currently being overhauled. It should be published in the next week or so. At that point, you can retest this, and if it's still an issue, we can fix it within the new argument buffer environment.
The descriptor_indexing sample in the official Khronos Vulkan-Samples repo fails (https://github.com/KhronosGroup/Vulkan-Samples/blob/main/samples/extensions/descriptor_indexing/descriptor_indexing.cpp), even with argument buffers enabled.
I have tracked down the issue, and it relates to exhaustion of the descriptor pool. The sample defines bindings with
set_layout_binding.descriptorCount = maxDescriptorSetUpdateAfterBindSampledImages
, i.e. the max. This seems excessive, but may not be an issue for other platforms that respect theVK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT
flag which is set by the sample.The problem arises when actually allocating descriptor sets, i.e. when calling
vkAllocateDescriptorSets()
extended by theVkDescriptorSetVariableDescriptorCountAllocateInfoEXT
structure. The structure properly defines the number of descriptors to be allocated (i.e.NumDescriptorsStreaming
andNumDescriptorsNonUniform
in two separate allocations), but MoltenVK's allocate action seems to check if there areset_layout_binding.descriptorCount
resources available in the pool, which in this case is 500,000 (the max) and of course this fails since it exceeds the pool size.I have been able to verify this and get the sample working by using
NumDescriptorsStreaming
in the binding definition, and by increasing the pool size to 2 xNumDescriptorsStreaming
(for 2 allocation calls). However, I suspect this may violate the spirit of the sample where variable descriptor count allocations are used.I am wondering whether MoltenVK supports the variable descriptor count flag and structure, and if so, should it instead be checking for
variable_info.pDescriptorCounts
resources in the pool when the variable bit is enabled and the variable descriptor count structure is present in the pNext chain ofallocate_info
.I am putting this forward as a question, since I may not have this right. However, I wanted to report it here before going back to the official sample repo and offering any solutions for MoltenVK in that forum.
The text was updated successfully, but these errors were encountered: