vulkan: Move allocate to command pool
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 1s

This commit is contained in:
Florian RICHER 2024-11-27 21:27:50 +01:00
parent a669247406
commit 4b08b7359d
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
3 changed files with 24 additions and 11 deletions

View file

@ -66,17 +66,9 @@ impl VkRenderContext {
let command_pool = VkCommandPool::new(&device)?;
let command_buffer_info = vk::CommandBufferAllocateInfo::default()
.command_pool(command_pool.handle)
.level(vk::CommandBufferLevel::PRIMARY)
.command_buffer_count(framebuffers.len() as u32);
// Destroyed with command pool
let command_buffers = unsafe {
device
.handle
.allocate_command_buffers(&command_buffer_info)?
};
let command_buffers = command_pool
.allocate_command_buffers_for_framebuffers(framebuffers.len() as u32)?;
let image_available_semaphore = VkSemaphore::new(&device)?;
let render_finished_semaphore = VkSemaphore::new(&device)?;