Skip to content

Commit a547820

Browse files
authored
Avoid a hang on linux by always create the renderer, even when we have no store_view (#5724)
### What - Mitigates: #5283 All this does is re-orders the calls so that we always create a renderer and call begin_frame / before_submit even if the case where we have no StoreView. In theory this uses a few more resources when skipping the welcome screen, but practically in almost all cases this is only for a few frames until log-data starts arriving. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using newly built examples: [app.rerun.io](https://app.rerun.io/pr/5724/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5724/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/5724/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! - [PR Build Summary](https://build.rerun.io/pr/5724) - [Docs preview](https://rerun.io/preview/9043a05f182790ade51cc78f6b979b5327d98617/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/9043a05f182790ade51cc78f6b979b5327d98617/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
1 parent b64d55f commit a547820

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

crates/re_viewer/src/app.rs

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -847,19 +847,23 @@ impl App {
847847

848848
self.egui_debug_panel_ui(ui);
849849

850-
if let Some(store_view) = store_context {
851-
let entity_db = store_view.recording;
852-
853-
// TODO(andreas): store the re_renderer somewhere else.
854-
let egui_renderer = {
855-
let render_state = frame.wgpu_render_state().unwrap();
856-
&mut render_state.renderer.write()
857-
};
858-
if let Some(render_ctx) = egui_renderer
859-
.callback_resources
860-
.get_mut::<re_renderer::RenderContext>()
861-
{
862-
render_ctx.begin_frame();
850+
// TODO(andreas): store the re_renderer somewhere else.
851+
let egui_renderer = {
852+
let render_state = frame.wgpu_render_state().unwrap();
853+
&mut render_state.renderer.write()
854+
};
855+
856+
if let Some(render_ctx) = egui_renderer
857+
.callback_resources
858+
.get_mut::<re_renderer::RenderContext>()
859+
{
860+
// TODO(#5283): There's no great reason to do this if we have no store-view and
861+
// subsequently won't actually be rendering anything. However, doing this here
862+
// avoids a hang on linux. Consider moving this back inside the below `if let`.
863+
// once the upstream issues that fix the hang properly have been resolved.
864+
render_ctx.begin_frame();
865+
if let Some(store_view) = store_context {
866+
let entity_db = store_view.recording;
863867

864868
self.state.show(
865869
app_blueprint,
@@ -873,15 +877,8 @@ impl App {
873877
&self.rx,
874878
&self.command_sender,
875879
);
876-
877-
render_ctx.before_submit();
878880
}
879-
} else {
880-
// There's nothing to show.
881-
// We get here when
882-
// A) there is nothing loaded
883-
// B) we decided not to show the welcome screen, presumably because data is expected at any time now.
884-
// The user can see the connection status in the top bar.
881+
render_ctx.before_submit();
885882
}
886883
});
887884
}

0 commit comments

Comments
 (0)