From: Stephen Seo Date: Wed, 20 Mar 2024 05:29:48 +0000 (+0900) Subject: WIP vulkan compute: create command pool X-Git-Url: https://git.seodisparate.com/tbm-edit-post-battle.jpg?a=commitdiff_plain;h=7cca2bfbff00a2a88b2fb634da3823f88da9b5af;p=blue_noise_generation WIP vulkan compute: create command pool --- 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";