Update [broken]
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 0s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 0s
This commit is contained in:
parent
8f1172e888
commit
1dc9da0d61
8 changed files with 222 additions and 31 deletions
29
src/vulkan/vk_semaphore.rs
Normal file
29
src/vulkan/vk_semaphore.rs
Normal file
|
@ -0,0 +1,29 @@
|
|||
use crate::vulkan::VkDevice;
|
||||
use ash::vk;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct VkSemaphore {
|
||||
device: Arc<VkDevice>,
|
||||
|
||||
pub(super) handle: vk::Semaphore,
|
||||
}
|
||||
|
||||
impl VkSemaphore {
|
||||
pub fn new(device: Arc<VkDevice>) -> anyhow::Result<Self> {
|
||||
let semaphore_info = vk::SemaphoreCreateInfo::default();
|
||||
let semaphore = unsafe { device.handle.create_semaphore(&semaphore_info, None)? };
|
||||
log::debug!("Semaphore created ({semaphore:?})");
|
||||
|
||||
Ok(Self {
|
||||
device,
|
||||
handle: semaphore,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for VkSemaphore {
|
||||
fn drop(&mut self) {
|
||||
unsafe { self.device.handle.destroy_semaphore(self.handle, None) };
|
||||
log::debug!("Semaphore destroyed ({:?})", self.handle);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue