Summary
Rust wgpu exposes native API surface for R64Uint atomic storage textures, but the wgpu-native C API does not appear to expose equivalent native C ABI values.
This means C API consumers cannot express WGSL resources such as:
@group(0) @binding(0)
var visibility_buffer: texture_storage_2d<r64uint, atomic>;
I am not asking for this to become WebGPU-standard API. This seems more appropriate as a wgpu-native native-only extension surface in wgpu.h.
Versions checked
wgpu-native: v29.0.0.0 latest release, checked ffi/wgpu.h
- Also observed in older release headers from
v27.0.4.0
- Rust
wgpu API used for comparison: wgpu 29.0.3
Rust API that exists
Rust wgpu exposes the required pieces:
wgpu::TextureFormat::R64Uint
wgpu::TextureUsages::STORAGE_ATOMIC
wgpu::StorageTextureAccess::Atomic
A Rust bind group layout can express:
wgpu::BindingType::StorageTexture {
access: wgpu::StorageTextureAccess::Atomic,
format: wgpu::TextureFormat::R64Uint,
view_dimension: wgpu::TextureViewDimension::D2,
}
C API surface that appears missing
In wgpu-native v29.0.0.0 ffi/wgpu.h, I can find native texture format constants such as:
WGPUNativeTextureFormat_R16Unorm
WGPUNativeTextureFormat_R16Snorm
WGPUNativeTextureFormat_Rg16Unorm
WGPUNativeTextureFormat_Rg16Snorm
WGPUNativeTextureFormat_Rgba16Unorm
WGPUNativeTextureFormat_Rgba16Snorm
WGPUNativeTextureFormat_NV12
WGPUNativeTextureFormat_P010
but no native C ABI equivalent for:
wgpu::TextureFormat::R64Uint
wgpu::TextureUsages::STORAGE_ATOMIC
wgpu::StorageTextureAccess::Atomic
Suggested direction
Would wgpu-native accept native-only C ABI constants for this capability in wgpu.h, for example:
WGPUNativeTextureFormat_R64Uint
WGPUNativeTextureUsage_StorageAtomic
WGPUNativeStorageTextureAccess_Atomic
The C descriptor conversion would then map these to:
wgpu_types::TextureFormat::R64Uint
wgpu_types::TextureUsages::STORAGE_ATOMIC
wgpu_types::StorageTextureAccess::Atomic
with the same feature/capability validation as the Rust API, notably TEXTURE_ATOMIC and TEXTURE_INT64_ATOMIC.
Question
Is a wgpu.h native extension the preferred way to make this Rust wgpu native capability available to C API users, or is there another intended C ABI path for R64Uint atomic storage textures?
Summary
Rust
wgpuexposes native API surface forR64Uintatomic storage textures, but thewgpu-nativeC API does not appear to expose equivalent native C ABI values.This means C API consumers cannot express WGSL resources such as:
I am not asking for this to become WebGPU-standard API. This seems more appropriate as a
wgpu-nativenative-only extension surface inwgpu.h.Versions checked
wgpu-native:v29.0.0.0latest release, checkedffi/wgpu.hv27.0.4.0wgpuAPI used for comparison:wgpu 29.0.3Rust API that exists
Rust
wgpuexposes the required pieces:A Rust bind group layout can express:
C API surface that appears missing
In
wgpu-native v29.0.0.0ffi/wgpu.h, I can find native texture format constants such as:but no native C ABI equivalent for:
wgpu::TextureFormat::R64Uintwgpu::TextureUsages::STORAGE_ATOMICwgpu::StorageTextureAccess::AtomicSuggested direction
Would
wgpu-nativeaccept native-only C ABI constants for this capability inwgpu.h, for example:The C descriptor conversion would then map these to:
wgpu_types::TextureFormat::R64Uintwgpu_types::TextureUsages::STORAGE_ATOMICwgpu_types::StorageTextureAccess::Atomicwith the same feature/capability validation as the Rust API, notably
TEXTURE_ATOMICandTEXTURE_INT64_ATOMIC.Question
Is a
wgpu.hnative extension the preferred way to make this Rustwgpunative capability available to C API users, or is there another intended C ABI path forR64Uintatomic storage textures?