-
Notifications
You must be signed in to change notification settings - Fork 353
Closed
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Description
Hi all,
I like to author some shaders in WebGL, on shadertoy or inside some work projects.
Here is my humble feedback after about 5h tinkering with WGSL:
var x : vec2<f32> = vec2<f32>(1. , 1.);gets old to type, vsvec2 x = vec2(1.,1.);for GLSL. I so often forget to put the type annotation, and current parsers are not that kind to point us towards the error.- Couldn't figure out how to bump the precision up. It caused a bunch of division by zero which do not fail but do garbage hard to debug
- For buffer uniforms, I didn't find any way to expose them over except wrapped through a struct, which forced me to use more accessors.
- I could not swizzle on function returns, like
textureSample(my_vec2).x, maybe an implementation limitation? - Accessors such as .rgba didn't work. Also maybe an implementation limitation?
- I didn't know how to handle const uniform expression, I usually put those outside the main in GLSL, but in WGSL it seems we put them into the main function and the compiler optimizes correctly. It's nice, but should be expressed somewhere, or documented I guess?
kvark, dylan-hart and sotrh
Metadata
Metadata
Assignees
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues