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

Avoid a hang on linux by always create the renderer, even when we have no store_view #5724

Merged
merged 1 commit into from
Mar 29, 2024
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
39 changes: 18 additions & 21 deletions crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,19 +847,23 @@ impl App {

self.egui_debug_panel_ui(ui);

if let Some(store_view) = store_context {
let entity_db = store_view.recording;

// TODO(andreas): store the re_renderer somewhere else.
let egui_renderer = {
let render_state = frame.wgpu_render_state().unwrap();
&mut render_state.renderer.write()
};
if let Some(render_ctx) = egui_renderer
.callback_resources
.get_mut::<re_renderer::RenderContext>()
{
render_ctx.begin_frame();
// TODO(andreas): store the re_renderer somewhere else.
let egui_renderer = {
let render_state = frame.wgpu_render_state().unwrap();
&mut render_state.renderer.write()
};

if let Some(render_ctx) = egui_renderer
.callback_resources
.get_mut::<re_renderer::RenderContext>()
{
// TODO(#5283): There's no great reason to do this if we have no store-view and
// subsequently won't actually be rendering anything. However, doing this here
// avoids a hang on linux. Consider moving this back inside the below `if let`.
// once the upstream issues that fix the hang properly have been resolved.
render_ctx.begin_frame();
if let Some(store_view) = store_context {
let entity_db = store_view.recording;

self.state.show(
app_blueprint,
Expand All @@ -873,15 +877,8 @@ impl App {
&self.rx,
&self.command_sender,
);

render_ctx.before_submit();
}
} else {
// There's nothing to show.
// We get here when
// A) there is nothing loaded
// B) we decided not to show the welcome screen, presumably because data is expected at any time now.
// The user can see the connection status in the top bar.
render_ctx.before_submit();
}
});
}
Expand Down
Loading