Closed Nielsbishere closed 4 years ago
Shader stages: No, the only supported stages are vertex, fragment, and compute. We don't have plans to add geometry shaders unless there is significant demand. Tessellation shaders are difficult because the shape of the API differs between backends (Vulkan, Metal, D3D12) so we don't have a plan for them yet either. Mesh and raytracing shaders are very new and only just becoming non-Nvidia-specific. Since these will be optional features, we will wait for these to mature and standardize further while we work on being able to ship the core API.
ASTC: We plan to guarantee that every platform has either BC or ETC2 support. ASTC is a likely later extension, but it's not a priority yet since ETC2 will be available on mobile. Support is exposed as GPUAdapter.extensions and must be requested with GPUDeviceDescriptor.extensions.
Vertex formats: The core vertex format list is approximately complete. Those which have not been included were removed for specific reasons (not available on some backend API, or on some hardware.) The 3- and 1-attribute vertex formats are IIRC not available on D3D12. RGB11_11_10 I don't remember offhand, but I think it's missing in Metal.
Shading language: The standard will be WGSL, and SPIR-V will not be supported. The WGSL spec and implementations (and tooling) are still in progress and not ready for use yet, though.
@Nielsbishere you should also clarify explicitly if you are interested in native-only, or the Web target with these headers. For native-only we can expose tessellation, mesh shades, whatever, on limited platforms, as native extensions. Same goes for SPIR-V, we can accept this for native-only scenario, at least.
For targetting web, so as far as I looked into this, that means using dawn with c++ webasm and the other web apis for input and stuff. Though I remember reading that apple had trouble with querying a lot of things in safari due to fingerprinting. I thought this repo was for c++ bindings for webasm/webgpu, but I guess this is more for a client running outside of the web?
This repo is for both. The idea is that if your app is built against this header, you can target both native and the Web. The other way to do this is via https://github.com/gfx-rs/wgpu-rs, which targets the Web directly (but it's Rust).
Ah nice, but dawn is the only C++ implementation?
The only C++ implementation as a library. WebKit has an implementation (or will have) in C++ but it's buried inside WebKit and not usable on its own.
Okay thanks guys. I'll keep this in mind. I think tesselation, mesh shaders and raytracing shaders will be really cool for the future of webgpu though. But of course first get a base that is safe, performant and cross platform which is a challenge to be sure.
Sorry, I got this in my email and didn't realize it was on the webgpu-headers repo when I wrote my reply.
We definitely expect many extensions/optional features to show up here that don't show up in WebGPU until later or never.
(Like SPIR-V, which is available in this header.)
I have the following questions:
Shader stages only contains vert, frag and comp. This means geom, tesc or tese are not available. Also extended shader types like mesh or RT shaders aren't. Will this be updated when the spec is more mature?
If this standard is going to be implemented on mobile, it will need ASTC texture compression support since BC won't work on there. And ways to query the support of things like formats and extensions. Is this in progress?
A lot of vertex formats are missing, such as RGB 11_11_10 and other compression related formats. 3 and 1 attribute vertex formats are also missing, though I guess that could be accomplished by rounding up to the next and then discarding an attribute. But this is still quite inconvenient. Will this be added?
I thought SPIRV was not the choice for webgpu, or is this still a debate? Or is this handled by transpiling spir-v to an intermediate and then compiling it again. In which case I'd rather have the build system take care of that.