Skip to content

Commit

Permalink
add feature RG11B10UFLOAT_RENDERABLE on web
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Apr 14, 2023
1 parent 7c25c00 commit cb34fea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
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 cb34fea

Please sign in to comment.