mirror of
https://github.com/italicsjenga/portability.git
synced 2025-02-23 17:47:43 +11:00
Release physical devices properly
This commit is contained in:
parent
78cfa871dd
commit
4005f014bd
2 changed files with 9 additions and 9 deletions
|
@ -60,8 +60,9 @@ pub extern "C" fn gfxDestroyInstance(
|
|||
instance: VkInstance,
|
||||
_pAllocator: *const VkAllocationCallbacks,
|
||||
) {
|
||||
let _ = instance.unbox();
|
||||
//let it drop
|
||||
for adapter in instance.unbox().adapters {
|
||||
let _ = adapter.unbox();
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
@ -32,14 +32,8 @@ pub use impls::*;
|
|||
|
||||
|
||||
// Vulkan objects
|
||||
pub type VkPhysicalDevice = Handle<hal::Adapter<B>>;
|
||||
|
||||
pub struct RawInstance {
|
||||
pub backend: back::Instance,
|
||||
pub adapters: Vec<VkPhysicalDevice>,
|
||||
}
|
||||
|
||||
pub type VkInstance = Handle<RawInstance>;
|
||||
pub type VkPhysicalDevice = Handle<hal::Adapter<B>>;
|
||||
pub type VkDevice = DispatchHandle<Gpu<B>>;
|
||||
pub type VkQueue = DispatchHandle<<B as hal::Backend>::CommandQueue>;
|
||||
pub type VkCommandPool = Handle<CommandPool<B>>;
|
||||
|
@ -63,6 +57,11 @@ pub type VkPipeline = Handle<Pipeline<B>>;
|
|||
|
||||
pub type QueueFamilyIndex = u32;
|
||||
|
||||
pub struct RawInstance {
|
||||
pub backend: back::Instance,
|
||||
pub adapters: Vec<VkPhysicalDevice>,
|
||||
}
|
||||
|
||||
pub struct Gpu<B: hal::Backend> {
|
||||
device: B::Device,
|
||||
queues: HashMap<QueueFamilyIndex, Vec<VkQueue>>,
|
||||
|
|
Loading…
Add table
Reference in a new issue