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

Warn user when a software rasterizer is used #5655

Merged
merged 4 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion crates/re_renderer/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ fn log_adapter_info(info: &wgpu::AdapterInfo) {
}

/// A human-readable summary about an adapter
fn adapter_info_summary(info: &wgpu::AdapterInfo) -> String {
pub fn adapter_info_summary(info: &wgpu::AdapterInfo) -> String {
let wgpu::AdapterInfo {
name,
vendor: _, // skip integer id
Expand Down
2 changes: 1 addition & 1 deletion crates/re_renderer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub use colormap::{
colormap_inferno_srgb, colormap_magma_srgb, colormap_plasma_srgb, colormap_srgb,
colormap_turbo_srgb, colormap_viridis_srgb, grayscale_srgb, Colormap,
};
pub use context::RenderContext;
pub use context::{adapter_info_summary, RenderContext};
pub use debug_label::DebugLabel;
pub use depth_offset::DepthOffset;
pub use line_drawable_builder::{LineDrawableBuilder, LineStripBuilder};
Expand Down
22 changes: 22 additions & 0 deletions crates/re_viewer/src/ui/top_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,28 @@ fn top_bar_ui(
connection_status_ui(ui, app.msg_receive_set());
}

if let Some(wgpu) = frame.wgpu_render_state() {
let info = wgpu.adapter.get_info();
if info.device_type == wgpu::DeviceType::Cpu {
// TODO(#4304): replace with a panel showing recent log messages
ui.hyperlink_to(
egui::RichText::new("⚠ Software rasterizer ⚠")
.small()
.color(ui.visuals().warn_fg_color),
"https://www.rerun.io/docs/getting-started/troubleshooting#graphics-issues",
)
.on_hover_ui(|ui| {
ui.label("Software rasterizer detected - expect poor performance.");
ui.label("Click for torubleshooting.");
ui.add_space(8.0);
ui.label(format!(
"wgpu adapter {}",
re_renderer::adapter_info_summary(&info)
));
});
}
}

// Warn if in debug build
if cfg!(debug_assertions) && !app.is_screenshotting() {
ui.vertical_centered(|ui| {
Expand Down
Loading