From 6146b5123d77f61fb35fd80cee26ab9b4d2838cb Mon Sep 17 00:00:00 2001 From: Conner Ebbinghaus Date: Tue, 27 Dec 2022 02:55:27 -0500 Subject: [PATCH 1/2] Fix panic due to missing swapchain texture. --- src/egui_node.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/egui_node.rs b/src/egui_node.rs index 581100d43..7fe00bc02 100644 --- a/src/egui_node.rs +++ b/src/egui_node.rs @@ -315,6 +315,13 @@ impl Node for EguiNode { return Ok(()); // No window }; + let swap_chain_texture = + if let Some(swap_chain_texture) = extracted_window.swap_chain_texture.as_ref() { + swap_chain_texture + } else { + return Ok(()); // No swapchain texture + }; + let render_queue = world.get_resource::().unwrap(); let (vertex_buffer, index_buffer) = match (&self.vertex_buffer, &self.index_buffer) { @@ -329,8 +336,6 @@ impl Node for EguiNode { let egui_transforms = world.get_resource::().unwrap(); - let swap_chain_texture = extracted_window.swap_chain_texture.as_ref().unwrap(); - let mut render_pass = render_context .command_encoder From 5dd73dfc1a775df6231c9d5c0da53c65e08f4235 Mon Sep 17 00:00:00 2001 From: Conner Ebbinghaus Date: Sun, 1 Jan 2023 14:00:05 -0500 Subject: [PATCH 2/2] Format. --- src/egui_node.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/egui_node.rs b/src/egui_node.rs index 7fe00bc02..1ee93cf90 100644 --- a/src/egui_node.rs +++ b/src/egui_node.rs @@ -315,13 +315,13 @@ impl Node for EguiNode { return Ok(()); // No window }; - let swap_chain_texture = + let swap_chain_texture = if let Some(swap_chain_texture) = extracted_window.swap_chain_texture.as_ref() { swap_chain_texture } else { return Ok(()); // No swapchain texture }; - + let render_queue = world.get_resource::().unwrap(); let (vertex_buffer, index_buffer) = match (&self.vertex_buffer, &self.index_buffer) {