diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 2ad87f79..2e7b32ed 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -75,6 +75,7 @@ set(EXAMPLES deferred deferredmultisampling deferredshadows + descriptorindexing descriptorsets displacement distancefieldfonts diff --git a/examples/descriptorindexing/descriptorindexing.cpp b/examples/descriptorindexing/descriptorindexing.cpp index a27c52fd..8d44034f 100644 --- a/examples/descriptorindexing/descriptorindexing.cpp +++ b/examples/descriptorindexing/descriptorindexing.cpp @@ -292,7 +292,17 @@ public: Descriptor sets */ + VkDescriptorSetVariableDescriptorCountAllocateInfo variableDescriptorCountAllocInfo = {}; + + uint32_t variableDescCounts[] = {textures.size()}; + + variableDescriptorCountAllocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO; + variableDescriptorCountAllocInfo.descriptorSetCount = 1; + variableDescriptorCountAllocInfo.pDescriptorCounts = variableDescCounts; + VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &descriptorSetLayout, 1); + allocInfo.pNext = &variableDescriptorCountAllocInfo; + VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &descriptorSet)); std::vector writeDescriptorSets(2);