Skip to content

Commit

Permalink
Always enable OpenGL fallback backend, fix --renderer=gl only worki…
Browse files Browse the repository at this point in the history
…ng together with `WGPU_BACKEND` env-var (#6582)

### What

Previously, we made the GL backend explicit opt-in (and accidentally
only via the wgpu env var, not solely via commandline). But I don't see
any reason for this as wgpu will (well, should) always prefer Vulkan
when available.

* Fixes [#5968](#5968)
* Reportedly there's still sometimes issues with he GL backend, but this
is captured now in #6581

### 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 examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6582?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6582?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/6582)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
Wumpf committed Jun 17, 2024
1 parent ba4642a commit 15ce558
Showing 1 changed file with 9 additions and 7 deletions.
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

0 comments on commit 15ce558

Please sign in to comment.