vulkan - Is this understanding of VkDescriptorPoolCreateInfo.pPoolSizes correct? -


in vulkan, understand descriptor pool used allocate descriptor sets of layout use in shader, in vkdescriptorpoolcreateinfo passed vkcreatedescriptorpool, there field ppoolsizes takes bunch of objects containing descriptor type , number.

the documentation seems vague, saying given descriptor pool can have certain, predetermined amount of each type of descriptor allocated in descriptor sets? if so, how determine how many need beforehand? happens if runs out?

your understanding of descriptor pools correct.

if so, how determine how many need beforehand?

that's , application's needs.

if application needs flexible , freeform, need create descriptor pools dynamically needed. if application has greater foreknowledge of scene like, application need fewer of such gymnastics.

many serious vulkan applications try avoid having number of descriptor sets based on number of objects in scene. push constants and/or dynamic ubo/ssbo descriptors allow different per-object state used without changing descriptor itself. textures lots of objects can bundled array textures, or depending on hardware, arrays of textures.

in perfect world, meshes of type (say, skinned meshes) rendered exact same descriptor set, using per-object state fetch right matrix/texture data object.

but that's how render. such applications have firm control on kinds of objects render, per-object data looks like, , forth. other applications may have different needs.

vulkan tool; how use entirely you.

what happens if runs out?

then cannot allocate more descriptors pool. if need allocate descriptor set, need create pool.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -