From 862f6a70c8efda372854e1fa2ab43cbb4afd9d79 Mon Sep 17 00:00:00 2001 From: zawz Date: Wed, 31 Jul 2024 10:14:20 +0200 Subject: [PATCH] chore: buffers into vec --- src/instance/mod.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/instance/mod.rs b/src/instance/mod.rs index 27ad04f..96a0df0 100644 --- a/src/instance/mod.rs +++ b/src/instance/mod.rs @@ -45,8 +45,7 @@ pub struct EngineInstance { pub pools: Pools, pub commandbuffers: Vec, pub allocator: std::mem::ManuallyDrop, - pub buffer1: Buffer, - pub buffer2: Buffer, + pub buffers: Vec, pub framecount: FrameCounter, } @@ -204,8 +203,7 @@ impl EngineInstance { pools, commandbuffers, allocator: std::mem::ManuallyDrop::new(allocator), - buffer1, - buffer2, + buffers: vec![buffer1, buffer2], framecount: FrameCounter::new(), }) } @@ -218,10 +216,9 @@ impl EngineInstance { self.pools.cleanup(&self.device); self.pipeline.cleanup(&self.device); - self.allocator - .free_buffer_allocation(&self.device, &mut self.buffer1); - self.allocator - .free_buffer_allocation(&self.device, &mut self.buffer2); + for buffer in &mut self.buffers { + self.allocator.free_buffer_allocation(&self.device, buffer); + } std::mem::ManuallyDrop::drop(&mut self.allocator); self.device.destroy_render_pass(self.renderpass, None);