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

Always enable OpenGL fallback backend, fix --renderer=gl only working together with WGPU_BACKEND env-var #6582

Merged
merged 1 commit into from
Jun 17, 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
16 changes: 9 additions & 7 deletions crates/re_renderer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,18 @@ pub struct RenderContextConfig {
/// Other backend might work as well, but lack of support isn't regarded as a bug.
pub fn supported_backends() -> wgpu::Backends {
if cfg!(native) {
// Native.
// Only use Vulkan & Metal unless explicitly told so since this reduces surfaces and thus surprises.
//
// Bunch of cases where it's still useful to switch though:
// * Some Windows VMs only provide DX12 drivers, observed with Parallels on Apple Silicon
// * May run into Linux issues that warrant trying out the GL backend.
// Native: Everything but DX12
// * Wgpu's DX12 impl isn't in a great shape yet and there's now reason to add more variation
// when we can just use Vulkan
// So far, the main reason against it would be that some Windows VMs only provide DX12 drivers,
// observed with Parallels on Apple Silicon. In the future we might want to reconsider
// based on surface/presentation support which may be better with DX12.
// * We'd like to exclude GL, but on Linux this can be a very useful fallback for users with
// with old hardware or bad/missing drivers. Wgpu automatically prefers Vulkan over GL when possible.
//
// For changing the backend we use standard wgpu env var, i.e. WGPU_BACKEND.
wgpu::util::backend_bits_from_env()
.unwrap_or(wgpu::Backends::VULKAN | wgpu::Backends::METAL)
.unwrap_or(wgpu::Backends::VULKAN | wgpu::Backends::METAL | wgpu::Backends::GL)
} else {
wgpu::Backends::GL | wgpu::Backends::BROWSER_WEBGPU
}
Expand Down
Loading