Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix panic due to missing swapchain texture. #141

Merged
merged 2 commits into from
Jan 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/egui_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<RenderQueue>().unwrap();

let (vertex_buffer, index_buffer) = match (&self.vertex_buffer, &self.index_buffer) {
Expand All @@ -329,8 +336,6 @@ impl Node for EguiNode {

let egui_transforms = world.get_resource::<EguiTransforms>().unwrap();

let swap_chain_texture = extracted_window.swap_chain_texture.as_ref().unwrap();

let mut render_pass =
render_context
.command_encoder
Expand Down