From cb34feabc5149705fa2eb75a35eb75ce99dcbfb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Fri, 14 Apr 2023 12:28:53 +0200 Subject: [PATCH 1/2] add feature RG11B10UFLOAT_RENDERABLE on web --- wgpu-types/src/lib.rs | 11 ++++++++++- wgpu/src/backend/web.rs | 6 +++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index 0804ba262e..360b9ed7cd 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -296,7 +296,16 @@ bitflags::bitflags! { // ? const FLOAT32_BLENDABLE = 1 << 20; (https://github.com/gpuweb/gpuweb/issues/3556) // ? const 32BIT_FORMAT_MULTISAMPLE = 1 << 21; (https://github.com/gpuweb/gpuweb/issues/3844) // ? const 32BIT_FORMAT_RESOLVE = 1 << 22; (https://github.com/gpuweb/gpuweb/issues/3844) - // TODO const RG11B10UFLOAT_RENDERABLE = 1 << 23; + + /// Allows for usage of textures of format [`TextureFormat::Rg11b10Float`] as a render target + /// + /// Supported platforms: + /// - Vulkan + /// - DX12 + /// - Metal + /// + /// This is a web and native feature. + const RG11B10UFLOAT_RENDERABLE = 1 << 23; /// Allows for explicit creation of textures of format [`TextureFormat::Depth32FloatStencil8`] /// diff --git a/wgpu/src/backend/web.rs b/wgpu/src/backend/web.rs index aab02fb500..743c51b9df 100644 --- a/wgpu/src/backend/web.rs +++ b/wgpu/src/backend/web.rs @@ -621,7 +621,7 @@ fn map_map_mode(mode: crate::MapMode) -> u32 { } } -const FEATURES_MAPPING: [(wgt::Features, web_sys::GpuFeatureName); 8] = [ +const FEATURES_MAPPING: [(wgt::Features, web_sys::GpuFeatureName); 9] = [ //TODO: update the name ( wgt::Features::DEPTH_CLIP_CONTROL, @@ -655,6 +655,10 @@ const FEATURES_MAPPING: [(wgt::Features, web_sys::GpuFeatureName); 8] = [ wgt::Features::SHADER_F16, web_sys::GpuFeatureName::ShaderF16, ), + ( + wgt::Features::RG11B10UFLOAT_RENDERABLE, + web_sys::GpuFeatureName::Rg11b10ufloatRenderable, + ), ]; fn map_wgt_features(supported_features: web_sys::GpuSupportedFeatures) -> wgt::Features { From ad5e825e4bbd26412b07ad545e5780cc3944f0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Fri, 14 Apr 2023 12:34:17 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0d421e50f..94705b3340 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -151,6 +151,7 @@ By @cwfitzgerald in [#3671](https://github.com/gfx-rs/wgpu/pull/3671). - Implement the new checks for readonly stencils. By @JCapucho in [#3443](https://github.com/gfx-rs/wgpu/pull/3443) - Reimplement `adapter|device_features`. By @jinleili in [#3428](https://github.com/gfx-rs/wgpu/pull/3428) - Implement `command_encoder_resolve_query_set`. By @JolifantoBambla in [#3489](https://github.com/gfx-rs/wgpu/pull/3489) +- Add support for `Features::RG11B10UFLOAT_RENDERABLE`. By @mockersf in [#3689](https://github.com/gfx-rs/wgpu/pull/3689) #### Vulkan