Skip to content

Commit

Permalink
Fix ASTC feature selection in the webgl backend (#3934)
Browse files Browse the repository at this point in the history
* Update glow to a new minor version, improve gles adapter astc feature selection
* Update Cargo.lock
* Add changelog entry
* Improve cfg flags to filter out emscripten
  • Loading branch information
expenses authored Jul 17, 2023
1 parent 7198d60 commit e4eb5b3
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Bottom level categories:
- Fix OpenGL/EGL backend not respecting non-sRGB texture formats in `SurfaceConfiguration`. by @liquidev in [#3817](https://github.com/gfx-rs/wgpu/pull/3817)
- Make write- and read-only marked buffers match non-readonly layouts. by @fornwall in [#3893](https://github.com/gfx-rs/wgpu/pull/3893)
- Fix leaking X11 connections. by @wez in [#3924](https://github.com/gfx-rs/wgpu/pull/3924)
- Fix ASTC feature selection in the webgl backend. by @expenses in [#3934](https://github.com/gfx-rs/wgpu/pull/3934)

#### Metal

Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ hassle-rs = "0.10.0"

# Gles dependencies
khronos-egl = "4.1"
glow = "0.12.2"
glow = "0.12.3"
glutin = "0.29.1"

# wasm32 dependencies
Expand Down
2 changes: 1 addition & 1 deletion wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ rustc-hash = "1.1"
log = "0.4"

# backend: Gles
glow = { version = "0.12.2", optional = true }
glow = { version = "0.12.3", optional = true }

[dependencies.wgt]
package = "wgpu-types"
Expand Down
23 changes: 21 additions & 2 deletions wgpu-hal/src/gles/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,27 @@ impl super::Adapter {
if extensions.contains("WEBGL_compressed_texture_astc")
|| extensions.contains("GL_OES_texture_compression_astc")
{
features.insert(wgt::Features::TEXTURE_COMPRESSION_ASTC);
features.insert(wgt::Features::TEXTURE_COMPRESSION_ASTC_HDR);
#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
{
if context
.glow_context
.compressed_texture_astc_supports_ldr_profile()
{
features.insert(wgt::Features::TEXTURE_COMPRESSION_ASTC);
}
if context
.glow_context
.compressed_texture_astc_supports_hdr_profile()
{
features.insert(wgt::Features::TEXTURE_COMPRESSION_ASTC_HDR);
}
}

#[cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))]
{
features.insert(wgt::Features::TEXTURE_COMPRESSION_ASTC);
features.insert(wgt::Features::TEXTURE_COMPRESSION_ASTC_HDR);
}
} else {
features.set(
wgt::Features::TEXTURE_COMPRESSION_ASTC,
Expand Down

0 comments on commit e4eb5b3

Please sign in to comment.