Fix ASTC feature selection in the webgl backend (#3934)

* 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
This commit is contained in:
Ashley
2023-07-18 00:40:53 +12:00
committed by GitHub
parent 7198d60f68
commit e4eb5b38ec
5 changed files with 26 additions and 6 deletions

View File

@@ -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

4
Cargo.lock generated
View File

@@ -1049,9 +1049,9 @@ checksum = "518faa5064866338b013ff9b2350dc318e14cc4fcd6cb8206d7e7c9886c98815"
[[package]]
name = "glow"
version = "0.12.2"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "807edf58b70c0b5b2181dd39fe1839dbdb3ba02645630dc5f753e23da307f762"
checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728"
dependencies = [
"js-sys",
"slotmap",

View File

@@ -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

View File

@@ -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"

View File

@@ -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,