I'm a bit confused by the language used in the spec concerning the descriptor bindings described by the VkDescriptorSetLayoutBinding struct. The binding element
is the binding number of this entry and corresponds to a resource of the same binding number in the shader stages.
As stated in 14.5.3
A variable identified with a DescriptorSet decoration of s and a Binding decoration of b indicates that this variable is associated with the
VkDescriptorSetLayoutBindingthat has a binding equal to b in pSetLayouts[s] that was specified inVkPipelineLayoutCreateInfo
So if I get this correctly the descriptor bindings described by the VkDescriptorSetLayoutBinding must have an entry for every active resource variable in that set. Which resource variable is referred to by each descriptor binding is dictated by the binding variable and the binding decoration of each variable.
So far so good. The confusing part is when calling vkUpdateDescriptorSets. Struct VkWriteDescriptorSet has element dstBindng which
is the descriptor binding within that set.
I'm confused by whether dstBindng's value must be the same with the binding number used as decoration in the variable resource, or it should be used as an index inside the VkDescriptorSetLayoutBinding array.
VkWriteDescriptorSet's dstBinding should refer to the elements of theVkDescriptorSetLayoutBindingas an index. - hiddenbit