gfx-rs/wgpu

adapter.features() doesn't expose all features in wasm

munrocket opened this issue · 1 comments

Description
adapter.features() doesn't expose all features in WebAssembly

Repro steps

  1. Create device with features
log::info!("adapter.limits = {:#?}", adapter.features()); // <-- not showing everything

let (device, queue) = adapter
  .request_device(
    &wgpu::DeviceDescriptor {
      label: Some("GPU Device"),
      features: adapter.features(), // <-- not allowing everything
      limits: wgpu::Limits::default(),
    },
    None,
  )
  1. Create shader or API with feature
enable chromium_experimental_subgroups; 

@compute @workgroup_size(256)
fn main(@builtin(subgroup_invocation_id) sg_id : u32) {
   //...
}
  1. Can't access to features that supported in adapter. Also can't access extensions by name. Can we register it somehow?

Expected vs observed behavior
It is not showing chromium-experimental-subgroups which can be fun to play with, also float32-filterable, rg11b10ufloat-renderable, bgra8unorm-storage, chromium-experimental-timestamp-query-inside-passes.

Platform
WebAssembly

I think only features from the spec will be present as we can't guarantee compatibility with chromium-experimental features.

float32-filterable, rg11b10ufloat-renderable and bgra8unorm-storage should work though.

(
wgt::Features::RG11B10UFLOAT_RENDERABLE,
webgpu_sys::GpuFeatureName::Rg11b10ufloatRenderable,
),
(
wgt::Features::BGRA8UNORM_STORAGE,
webgpu_sys::GpuFeatureName::Bgra8unormStorage,
),
(
wgt::Features::FLOAT32_FILTERABLE,
webgpu_sys::GpuFeatureName::Float32Filterable,
),