Skip to content

Commit 1737eae

Browse files
authored
Demote OpenGL to optional feature (#20793)
# Objective In practice, we don't test OpenGL support and it's been reported broken for several releases. ## Solution Make the `gles` feature for `wgpu` optional, reflecting our level of support.
1 parent 1c10a42 commit 1737eae

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

crates/bevy_render/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ tracing-tracy = ["dep:tracy-client"]
4040
ci_limits = []
4141
webgl = ["wgpu/webgl"]
4242
webgpu = ["wgpu/webgpu"]
43+
gles = ["wgpu/gles"]
4344
detailed_trace = []
4445
## Adds serialization support through `serde`.
4546
serialize = ["bevy_mesh/serialize"]
@@ -86,7 +87,6 @@ wgpu = { version = "26", default-features = false, features = [
8687
"dx12",
8788
"metal",
8889
"vulkan",
89-
"gles",
9090
"naga-ir",
9191
"fragile-send-sync-non-atomic-wasm",
9292
] }

crates/bevy_render/src/settings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ pub enum WgpuSettingsPriority {
2727
/// [`Backends::VULKAN`](Backends::VULKAN) are enabled by default for non-web and the best choice
2828
/// is automatically selected. Web using the `webgl` feature uses [`Backends::GL`](Backends::GL).
2929
/// NOTE: If you want to use [`Backends::GL`](Backends::GL) in a native app on `Windows` and/or `macOS`, you must
30-
/// use [`ANGLE`](https://github.com/gfx-rs/wgpu#angle). This is because wgpu requires EGL to
31-
/// create a GL context without a window and only ANGLE supports that.
30+
/// use [`ANGLE`](https://github.com/gfx-rs/wgpu#angle) and enable the `gles` feature. This is
31+
/// because wgpu requires EGL to create a GL context without a window and only ANGLE supports that.
3232
#[derive(Clone)]
3333
pub struct WgpuSettings {
3434
pub device_label: Option<Cow<'static, str>>,

crates/bevy_render/src/view/window/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ impl WindowSurfaces {
205205
/// `DirectX 11` is not supported by wgpu 0.12 and so if your GPU/drivers do not support Vulkan,
206206
/// it may be that a software renderer called "Microsoft Basic Render Driver" using `DirectX 12`
207207
/// will be chosen and performance will be very poor. This is visible in a log message that is
208-
/// output during renderer initialization. Future versions of wgpu will support `DirectX 11`, but
209-
/// another alternative is to try to use [`ANGLE`](https://github.com/gfx-rs/wgpu#angle) and
210-
/// [`Backends::GL`](crate::settings::Backends::GL) if your GPU/drivers support `OpenGL 4.3` / `OpenGL ES 3.0` or
211-
/// later.
208+
/// output during renderer initialization.
209+
/// Another alternative is to try to use [`ANGLE`](https://github.com/gfx-rs/wgpu#angle) and
210+
/// [`Backends::GL`](crate::settings::Backends::GL) with the `gles` feature enabled if your
211+
/// GPU/drivers support `OpenGL 4.3` / `OpenGL ES 3.0` or later.
212212
pub fn prepare_windows(
213213
mut windows: ResMut<ExtractedWindows>,
214214
mut window_surfaces: ResMut<WindowSurfaces>,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: "OpenGL ES `wgpu` backend is no longer supported by default"
3+
pull_requests: [ 20793 ]
4+
---
5+
6+
The `gles` backend for `wgpu` is no longer included as a default feature of `bevy_render`. OpenGL support is still
7+
available, but must be explicitly enabled by adding the `bevy_render/gles` feature to your app. This change reflects the
8+
fact that OpenGL support is not tested and that some features may not work as expected or at all. We welcome
9+
contributions to improve OpenGL support in the future.

0 commit comments

Comments
 (0)