From 7cca2bfbff00a2a88b2fb634da3823f88da9b5af Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 20 Mar 2024 14:29:48 +0900 Subject: [PATCH] WIP vulkan compute: create command pool --- src/blue_noise.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/blue_noise.cpp b/src/blue_noise.cpp index b90dcc1..3bb2361 100644 --- a/src/blue_noise.cpp +++ b/src/blue_noise.cpp @@ -425,6 +425,25 @@ image::Bl dither::blue_noise(int width, int height, int threads, }, &compute_pipeline); } + + VkCommandPool command_pool; + { + VkCommandPoolCreateInfo pool_info{}; + pool_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; + pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT; + pool_info.queueFamilyIndex = indices.computeFamily.value(); + + if (vkCreateCommandPool(device, &pool_info, nullptr, &command_pool) != + VK_SUCCESS) { + std::clog << "WARNING: Failed to create vulkan command pool!\n"; + goto ENDOF_VULKAN; + } + } + utility::Cleanup cleanup_command_pool( + [device](void *ptr) { + vkDestroyCommandPool(device, *((VkCommandPool *)ptr), nullptr); + }, + &command_pool); } ENDOF_VULKAN: std::clog << "TODO: Remove this once Vulkan support is implemented.\n";