Re:WebGPU and the Price of Compiling WGSL
by l11d on Monday October 06, 2025 @07:26PM
(#45497473)
One of the problems is that libraries consuming SPIR-V are generally not robust enough to handle untrusted web shaders. Also, DirectX doesn't (yet) accept SPIR-V shaders so you'd mandate some translation to HLSL, which in turn would be compiled by dxcompiler.dll
[ Parent
| on HN ]
Re:WebGPU and the Price of Compiling WGSL
by lights0123 on Monday October 06, 2025 @08:16PM
(#45497851)
You could always translate to DXIL directly, though the Chromium team has brought up drivers are used to DXC's output
Re:WebGPU and the Price of Compiling WGSL
by elabajaba on Monday October 06, 2025 @08:31PM
(#45497983)
No need to transcode to HLSL, DXC already accepts SPIR-V input (and both Chrome and FF are shipping DXC).
Re:WebGPU and the Price of Compiling WGSL
by MindSpunk on Monday October 06, 2025 @08:37PM
(#45498028)
But writing an entirely new, bespoke high-level shader programming language is more robust? And robust in what way? The SPIR-V format is vastly easier to parse than a textual language.
And WGSL will still bounce through HLSL for DirectX because DXIL is an awful, undocumented mess of ancient LLVM-IR with a giant pile of bolt-on special semantics. Directly authoring DXIL is awful.