diff --git a/vulkano/src/sync/event.rs b/vulkano/src/sync/event.rs index 5326c546..86d2bebc 100644 --- a/vulkano/src/sync/event.rs +++ b/vulkano/src/sync/event.rs @@ -12,6 +12,7 @@ use std::ptr; use std::sync::Arc; use device::Device; +use device::DeviceOwned; use OomError; use Success; use VulkanObject; @@ -130,6 +131,13 @@ impl Event { } } +unsafe impl DeviceOwned for Event { + #[inline] + fn device(&self) -> &Arc { + &self.device + } +} + unsafe impl VulkanObject for Event { type Object = vk::Event; diff --git a/vulkano/src/sync/fence.rs b/vulkano/src/sync/fence.rs index 3bd3bf90..5874cd34 100644 --- a/vulkano/src/sync/fence.rs +++ b/vulkano/src/sync/fence.rs @@ -18,6 +18,7 @@ use std::time::Duration; use smallvec::SmallVec; use device::Device; +use device::DeviceOwned; use Error; use OomError; use SafeDeref; @@ -237,6 +238,13 @@ impl Fence where D: SafeDeref { } } +unsafe impl DeviceOwned for Fence { + #[inline] + fn device(&self) -> &Arc { + &self.device + } +} + unsafe impl VulkanObject for Fence where D: SafeDeref { type Object = vk::Fence; diff --git a/vulkano/src/sync/semaphore.rs b/vulkano/src/sync/semaphore.rs index 75f0ba48..059b777f 100644 --- a/vulkano/src/sync/semaphore.rs +++ b/vulkano/src/sync/semaphore.rs @@ -12,6 +12,7 @@ use std::ptr; use std::sync::Arc; use device::Device; +use device::DeviceOwned; use OomError; use SafeDeref; use VulkanObject; @@ -66,6 +67,13 @@ impl Semaphore where D: SafeDeref { } } +unsafe impl DeviceOwned for Semaphore { + #[inline] + fn device(&self) -> &Arc { + &self.device + } +} + unsafe impl VulkanObject for Semaphore where D: SafeDeref { type Object = vk::Semaphore;