KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.98k stars 823 forks source link

add --target-env webgpu0? #2489

Closed Trass3r closed 4 months ago

Trass3r commented 3 years ago

So one doesn't have to guess the workflow:

glslangValidator -V110 --target-env vulkan1.1 [--spirv-val]
spirv-opt --vulkan-to-webgpu --upgrade-memory-model
spirv-val --target-env webgpu0
dneto0 commented 3 years ago

Shaderc's glslc has the following flow:

glslc -mfmt=wgsl a.comp -o a.wgsl

That does:

I think that's what most people will want for targeting WebGPU.

To get that functionality, use Cmake variable SHADERC_ENABLE_WGSL_OUTPUT=ON, and make sure you have the Tint sources in third_party. Sorry that's not documented on the Shader README (yet).

Trass3r commented 3 years ago

IIRC glslc is not readily installable via apt though and the prebuilt binaries I found don't contain support for webgpu.

arcady-lunarg commented 4 months ago

This is currently out of scope for glslang, as mentioned glslc is a good alternative here and I see it in Ubuntu's package repository now.