mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 14:56:42 +00:00
Implement trim() for command pools
This commit is contained in:
parent
d2b9379d3b
commit
705cff5edc
@ -106,6 +106,19 @@ impl UnsafeCommandPool {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Trims a command pool, which recycles unused internal memory from the command pool back to the system.
|
||||
///
|
||||
/// Command buffers allocated from the pool are not affected by trimming.
|
||||
#[inline]
|
||||
pub fn trim(&self) -> () {
|
||||
assert!(self.device.loaded_extensions().khr_maintenance1); //TODO return error?
|
||||
unsafe {
|
||||
let flags = 0;
|
||||
let vk = self.device.pointers();
|
||||
vk.TrimCommandPoolKHR(self.device.internal_object(), self.pool, flags);
|
||||
}
|
||||
}
|
||||
|
||||
/// Allocates `count` command buffers.
|
||||
///
|
||||
/// If `secondary` is true, allocates secondary command buffers. Otherwise, allocates primary
|
||||
|
@ -210,6 +210,7 @@ device_extensions! {
|
||||
khr_swapchain => b"VK_KHR_swapchain",
|
||||
khr_display_swapchain => b"VK_KHR_display_swapchain",
|
||||
khr_sampler_mirror_clamp_to_edge => b"VK_KHR_sampler_mirror_clamp_to_edge",
|
||||
khr_maintenance1 => b"VK_KHR_maintenance1",
|
||||
}
|
||||
|
||||
/// Error that can happen when loading the list of layers.
|
||||
|
Loading…
Reference in New Issue
Block a user