Binding model problem

Hello,

Just started up a few days ago with Vulkan Api and i’m a bt confused with descriptor sets and binding values.

most samples around are doing this way ->

VkDescriptorSetLayoutBinding bindings = {
// binding 0 is a UBO, array size 1, visible to vertex stages
{ 0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT, NULL },
// binding 1 is a sampler, array size 1, visible to fragment stages
{ 1, VK_DESCRIPTOR_TYPE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, NULL },
};

notice that binding value is generally incremented (here binding 0 for uniform then 1 for sampler)
it’s not a surprise because vulkan validation is not permiting same binding values in this kind of configuration, unfortunately it’s not really flexible nor useful:-/

That’s a problem for me because i would like to bind my resources at index 0 for each stage.

say:

binding 0 for uniforms at vertex stage.
binding 0 for sampler at fragment stage.

Well for some reasons, i can’t get it to work… should i create multiple descriptor sets based on others multiple layout bindings ?

any help and clarifications would be appreciated on the subject.

thx