chore: buffers into vec
This commit is contained in:
parent
7be29cb3a9
commit
862f6a70c8
1 changed files with 5 additions and 8 deletions
|
|
@ -45,8 +45,7 @@ pub struct EngineInstance {
|
||||||
pub pools: Pools,
|
pub pools: Pools,
|
||||||
pub commandbuffers: Vec<vk::CommandBuffer>,
|
pub commandbuffers: Vec<vk::CommandBuffer>,
|
||||||
pub allocator: std::mem::ManuallyDrop<BufferAllocator>,
|
pub allocator: std::mem::ManuallyDrop<BufferAllocator>,
|
||||||
pub buffer1: Buffer,
|
pub buffers: Vec<Buffer>,
|
||||||
pub buffer2: Buffer,
|
|
||||||
pub framecount: FrameCounter,
|
pub framecount: FrameCounter,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -204,8 +203,7 @@ impl EngineInstance {
|
||||||
pools,
|
pools,
|
||||||
commandbuffers,
|
commandbuffers,
|
||||||
allocator: std::mem::ManuallyDrop::new(allocator),
|
allocator: std::mem::ManuallyDrop::new(allocator),
|
||||||
buffer1,
|
buffers: vec![buffer1, buffer2],
|
||||||
buffer2,
|
|
||||||
framecount: FrameCounter::new(),
|
framecount: FrameCounter::new(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -218,10 +216,9 @@ impl EngineInstance {
|
||||||
self.pools.cleanup(&self.device);
|
self.pools.cleanup(&self.device);
|
||||||
self.pipeline.cleanup(&self.device);
|
self.pipeline.cleanup(&self.device);
|
||||||
|
|
||||||
self.allocator
|
for buffer in &mut self.buffers {
|
||||||
.free_buffer_allocation(&self.device, &mut self.buffer1);
|
self.allocator.free_buffer_allocation(&self.device, buffer);
|
||||||
self.allocator
|
}
|
||||||
.free_buffer_allocation(&self.device, &mut self.buffer2);
|
|
||||||
std::mem::ManuallyDrop::drop(&mut self.allocator);
|
std::mem::ManuallyDrop::drop(&mut self.allocator);
|
||||||
|
|
||||||
self.device.destroy_render_pass(self.renderpass, None);
|
self.device.destroy_render_pass(self.renderpass, None);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue