Skip to content

Commit

Permalink
add feature RG11B10UFLOAT_RENDERABLE on webgpu (#3689)
Browse files Browse the repository at this point in the history
* add feature RG11B10UFLOAT_RENDERABLE on web

* changelog
  • Loading branch information
mockersf authored Apr 14, 2023
1 parent 7c25c00 commit bf8e6fe
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 10 additions & 1 deletion wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`]
///
Expand Down
6 changes: 5 additions & 1 deletion wgpu/src/backend/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit bf8e6fe

Please sign in to comment.