Skip to content

Commit abb0af4

Browse files
committed
[update] winit builder, reset command pools & free their underlying memory from the GPU explicitly.
1 parent 0e8e441 commit abb0af4

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

crates/lambda-platform/src/gfx/command.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,9 @@ impl<RenderBackend: gfx_hal::Backend> CommandPool<RenderBackend> {
381381
/// Moves the command pool into itself and destroys any command pool and
382382
/// buffer resources allocated on the GPU.
383383
#[inline]
384-
pub fn destroy(self, gpu: &super::gpu::Gpu<RenderBackend>) {
384+
pub fn destroy(mut self, gpu: &super::gpu::Gpu<RenderBackend>) {
385385
unsafe {
386+
self.command_pool.reset(true);
386387
super::gpu::internal::logical_device_for(gpu)
387388
.destroy_command_pool(self.command_pool);
388389
}

crates/lambda-platform/src/gfx/framebuffer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use super::{
1010
};
1111

1212
/// Framebuffer for the given render backend.
13+
#[derive(Debug)]
1314
pub struct Framebuffer<RenderBackend: gfx_hal::Backend> {
1415
frame_buffer: RenderBackend::Framebuffer,
1516
}

crates/lambda-platform/src/gfx/gpu.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ impl<RenderBackend: gfx_hal::Backend> Gpu<RenderBackend> {
158158
let (render_surface, render_image) =
159159
super::surface::internal::borrow_surface_and_take_image(surface);
160160

161-
println!("Rendering to surface.");
162161
let result = unsafe {
163162
self.queue_group.queues[0].present(
164163
render_surface,
@@ -174,8 +173,6 @@ impl<RenderBackend: gfx_hal::Backend> Gpu<RenderBackend> {
174173
);
175174
}
176175

177-
println!("Rendered to surface.");
178-
179176
return Ok(());
180177
}
181178
}

crates/lambda-platform/src/winit/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use winit::{
77
event_loop::{
88
ControlFlow,
99
EventLoop,
10+
EventLoopBuilder,
1011
EventLoopProxy,
1112
EventLoopWindowTarget,
1213
},
@@ -45,7 +46,7 @@ impl LoopBuilder {
4546
}
4647

4748
pub fn build<Events: 'static + std::fmt::Debug>(self) -> Loop<Events> {
48-
let event_loop = EventLoop::<Events>::with_user_event();
49+
let event_loop = EventLoopBuilder::<Events>::with_user_event().build();
4950
return Loop { event_loop };
5051
}
5152
}

0 commit comments

Comments
 (0)