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

Fix ASTC feature selection in the webgl backend #3934

Merged
merged 4 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
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
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should go into a gl section, but looks like the bug fixes section is all over the place right now. can be cleaned up some point before the next release


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