@@ -229,9 +229,8 @@ class VulkanExample : public VulkanExampleBase
229229 stagingBuffer.destroy ();
230230 }
231231
232- void prepareGraphics ()
232+ void prepareDescriptorPool ()
233233 {
234- // Descriptor pool
235234 // This is shared between graphics and compute
236235 std::vector<VkDescriptorPoolSize> poolSizes = {
237236 vks::initializers::descriptorPoolSize (VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, maxConcurrentFrames * 2 ),
@@ -240,7 +239,10 @@ class VulkanExample : public VulkanExampleBase
240239 };
241240 VkDescriptorPoolCreateInfo descriptorPoolInfo = vks::initializers::descriptorPoolCreateInfo (poolSizes, maxConcurrentFrames * 2 );
242241 VK_CHECK_RESULT (vkCreateDescriptorPool (device, &descriptorPoolInfo, nullptr , &descriptorPool));
242+ }
243243
244+ void prepareGraphics ()
245+ {
244246 // Descriptor layout
245247 std::vector<VkDescriptorSetLayoutBinding> setLayoutBindings;
246248 setLayoutBindings = {
@@ -257,7 +259,6 @@ class VulkanExample : public VulkanExampleBase
257259 VK_CHECK_RESULT (buffer.map ());
258260 }
259261
260- // Descriptor set
261262 // Sets per frame, just like the buffers themselves
262263 for (auto i = 0 ; i < graphics.uniformBuffers .size (); i++) {
263264 VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo (descriptorPool, &graphics.descriptorSetLayout , 1 );
@@ -411,6 +412,7 @@ class VulkanExample : public VulkanExampleBase
411412 vkWaitSemaphoresKHR = reinterpret_cast <PFN_vkWaitSemaphoresKHR>(vkGetDeviceProcAddr (device, " vkWaitSemaphoresKHR" ));
412413
413414 loadAssets ();
415+ prepareDescriptorPool ();
414416 prepareStorageBuffers ();
415417 prepareGraphics ();
416418 prepareCompute ();
0 commit comments