Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transpile WebGPU SpirV shaders into WGSL #5015

Merged
merged 1 commit into from
Jan 27, 2023
Merged

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jan 27, 2023

Latest Chrome Canary (111.0) removed support for deprecated WebGPU support for SpirV shaders, and those need to be specified in WGSL format.

For this we now use the Tint compiler (it is the compiler for Dawn: https://dawn.googlesource.com/tint, and it has an executable that can consume SPIR-V and emit WGSL).

The WASM build of Tint was obtained here:
https://forum.babylonjs.com/t/can-i-use-the-tintwasm-library-in-the-babylon-js-repository/23673

Current WebGPU shader transpiling:

  • GLSL => SpirV => WGSL

This breaks support for directional shadows (shader which passes the shadow map to a function no longer compiles) which will be investigated separately.

@mvaligursky mvaligursky self-assigned this Jan 27, 2023
@mvaligursky mvaligursky added the area: graphics Graphics related issue label Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants