Seems like the validator is expecting a type declaration for gl_Position? Maybe required if its hoisting into a struct before codegen. If thats the case, could be for runtime or just validation (in which case disabling validation would work). You can disable validation by setting debug to false on some class, im on my phone atm and too hard to find in source or docs. There is also a compile hook you could try, its something like “processShaderCode”, definitely starts with the word process. Maybe wont make it that far though, in which case u’ll definitely have to disable validation
Unrelated to debugging, i think wgsl recently had some change for type inference like typescript where untyped lhs is ok when rhs is typed. Idk if that applies here or not.
Many thanks @Evgeni_Popov , that will help me tracking down issues.
Yes the shader has bugs, however the engine blind rewrite is what was hindering me, being able to log the actual code is of great help.
The idea is to make a CYOS clone that can handle all versions (WebGL 1.0/2.0 and BabylonJS flavoured WGSL), so being able to see what the engine does with the code is quite relevant.