vulkan: Move allocate to command pool
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 1s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 1s
This commit is contained in:
parent
a669247406
commit
4b08b7359d
3 changed files with 24 additions and 11 deletions
|
@ -27,6 +27,21 @@ impl VkCommandPool {
|
|||
handle: command_pool,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn allocate_command_buffers_for_framebuffers(&self, framebuffers_count: u32) -> VkResult<Vec<vk::CommandBuffer>> {
|
||||
let command_buffer_info = vk::CommandBufferAllocateInfo::default()
|
||||
.command_pool(self.handle)
|
||||
.level(vk::CommandBufferLevel::PRIMARY)
|
||||
.command_buffer_count(framebuffers_count);
|
||||
|
||||
let command_buffers = unsafe {
|
||||
self.device
|
||||
.handle
|
||||
.allocate_command_buffers(&command_buffer_info)?
|
||||
};
|
||||
|
||||
Ok(command_buffers)
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for VkCommandPool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue