You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Post-fix prohibitions: It's even weird to be prohibited from point a f at the back of floating given the above requirements. It's not obvious how doubles would be supported. Allow f suffix for float literals #2210
Summary: Shaders authors expect a C-like syntax, even Metal being C++ like still supports C style syntax. WGSL is surprising in that it seems to be neither fully C-style nor C++-style.
Here's some feedback that one of the internal teams had when starting out with WGSL:
vert.VertexIndex % 3u == 0uRequiring integral-valued float literals to have .0 seems gratuitous #739.0to numbers to make them floating point:vec4<f32>(1, 0, 0, 1)must bevec4<f32>(1.0, 0.0, 0.0, 1.0)Requiring integral-valued float literals to have .0 seems gratuitous #739fat the back of floating given the above requirements. It's not obvious how doubles would be supported. Allow f suffix for float literals #2210elseifinstead ofelse if: Okay, but why? Consider replacing elseif with else if #2212Summary: Shaders authors expect a C-like syntax, even Metal being C++ like still supports C style syntax. WGSL is surprising in that it seems to be neither fully C-style nor C++-style.
Update
output.position.x = (float)(vert.VertexID / 2u) * 4.0 - 1.0;C-style casts #2220