-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Does MVK support VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT? #2246
Comments
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. |
Thanks for the heads up and I will retest when you release your new argument buffer code. |
Thanks for supplying the sample to replicate this issue. Confirmed issue. Working on it. |
This is fixed in PR #2273. Please retest with latest MoltenVK, and close this issue if it fixes the problem. |
Verified as working with the official Khronos descriptor indexing sample using MoltenVK 1.2.10 on macOS Ventura 13.6.6 (x86) and iOS 17.5.1 on iPhone 15. Thanks for fixing! |
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: