gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
11.97k stars 870 forks source link

Investigate non-32bit integer support #3406

Open teoxoy opened 1 year ago

teoxoy commented 1 year ago

Vulkan has quite a lot of int related capabilities and I don't see us exposing this level of granularity.

shaderInt64

shaderInt16 storageBuffer16BitAccess/uniformAndStorageBuffer16BitAccess/storagePushConstant16/storageInputOutput16 (Vulkan 1.1 / VK_KHR_16bit_storage)

shaderInt8 (Vulkan 1.2 / VK_KHR_shader_float16_int8) storageBuffer8BitAccess/uniformAndStorageBuffer8BitAccess/storagePushConstant8 (Vulkan 1.2 / VK_KHR_8bit_storage)

It would be nice to adapt https://github.com/kainino0x/gpuinfo-vulkan-query to see which of those capabilities we can coalesce.

We should also look into what D3D and Metal support as well.

Elabajaba commented 1 year ago

For D3D, non-32bit ints are generally supported but legacy support makes 16-bit ints weird and both OS and compiler dependent.

https://github.com/microsoft/DirectXShaderCompiler/wiki/16-Bit-Scalar-Types

https://gpuopen.com/learn/first-steps-implementing-fp16/