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

Lower limits requested of the graphics backend #1273

Merged
merged 1 commit into from
Oct 26, 2022
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
14 changes: 13 additions & 1 deletion crates/fj-viewer/src/graphics/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,24 @@ impl Renderer {
desired_features.intersection(available_features)
};

let limits = {
// This is the lowest of the available defaults. It should guarantee
// that we can run pretty much everywhere.
let lowest_limits = wgpu::Limits::downlevel_webgl2_defaults();

// However, these lowest limits aren't necessarily capable of
// supporting the screen resolution of our current platform, so
// let's amend them.
let supported_limits = adapter.limits();
lowest_limits.using_resolution(supported_limits)
};

let (device, queue) = adapter
.request_device(
&wgpu::DeviceDescriptor {
label: None,
features,
limits: wgpu::Limits::default(),
limits,
},
None,
)
Expand Down