Question: Is GLSL -> GLSL (for opengl) ready? #1839
-
Hi everybody! I have a project that uses I would love to implement a WGPU backend for my project, but I need to go step by step. The first step if possible will be move from spirv to naga using as input GLSL 450 and as output GLSL compatible with GL 3.3, ES 3, and WebGL 2. I apologize if this is a dumb question, I am not so much into shaders and shader compilation. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
This is an hard question to answer glsl is a big language and supporting all of it takes a lot of work but Since the front ends convert everything to the same intermediate representation the glsl output should work fine whether you use wgsl or glsl as the input. The versions you want to use are supported both on the frontend and backend. Veloren did revert the Basically, it's a supported use case and should work but you need to test it and it might contain bugs. |
Beta Was this translation helpful? Give feedback.
-
Please note, that OpenGL ES 3.0 backend available only for Linux & Android. On Windows it required angle lib (more info in README). |
Beta Was this translation helpful? Give feedback.
-
Got it, I may try to migrate to naga leaving spirv under a feature flag in case somebody wants to use spirv instead of naga for a while. Do you think that using WGSL as input will be better? Thanks! |
Beta Was this translation helpful? Give feedback.
-
WGSL is a great modern shader language, but spec still under development. If it not scared you, you can try, otherwise I recommended to wait 1.0 version. |
Beta Was this translation helpful? Give feedback.
-
We can close this, thank you so much for the kind answers. |
Beta Was this translation helpful? Give feedback.
This is an hard question to answer glsl is a big language and supporting all of it takes a lot of work but
naga
already supports a lot so it should support most of the inputs you throw at it (if not you can always open an issue ;).Since the front ends convert everything to the same intermediate representation the glsl output should work fine whether you use wgsl or glsl as the input.
The versions you want to use are supported both on the frontend and backend.
Veloren did revert the
naga
changes but this was because of a bug inspirv-cross
, the backend thatwgpu
previously used for shader translation, that caused msl output to be broken, this was caused because the shaders naga produced t…