Update [broken]
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 0s

This commit is contained in:
Florian RICHER 2024-11-20 17:45:26 +01:00
parent 8f1172e888
commit 1dc9da0d61
8 changed files with 222 additions and 31 deletions

View file

@ -0,0 +1,31 @@
use crate::vulkan::VkDevice;
use ash::prelude::VkResult;
use ash::vk;
use std::sync::Arc;
pub struct VkCommandPool {
device: Arc<VkDevice>,
pub(super) handle: vk::CommandPool,
}
impl VkCommandPool {
pub fn new(device: Arc<VkDevice>) -> VkResult<Self> {
let command_pool_info = vk::CommandPoolCreateInfo::default()
.queue_family_index(device.queue_family_index);
let command_pool = unsafe { device.handle.create_command_pool(&command_pool_info, None)? };
log::debug!("Command pool created ({command_pool:?})");
Ok(Self {
device,
handle: command_pool,
})
}
}
impl Drop for VkCommandPool {
fn drop(&mut self) {
unsafe { self.device.handle.destroy_command_pool(self.handle, None) };
log::debug!("Command pool destroyed ({:?})", self.handle);
}
}