webgpu / webgpufundamentals

https://webgpufundamentals.org
BSD 3-Clause "New" or "Revised" License
665 stars 96 forks source link

Minor but confusing typos in an example on the WGSL page #179

Open tomholcomb opened 1 month ago

tomholcomb commented 1 month ago

The example code under the vector construction heading on the WGSL page has three minor typos that I'd like to fix:

The sample says:

let a = vec4f(1, 2, 3, 4);
let b = vec2f(2, 3);
let c = vec4f(1, b, 4);
let d = vec2f(1, a.yz, 4);
let e = vec2f(a.xyz, 4);
let f = vec2f(1, a.yzw);

and I believe it should say:

let a = vec4f(1, 2, 3, 4);
let b = vec2f(2, 3);
let c = vec4f(1, b, 4);
let d = vec4f(1, a.yz, 4);
let e = vec4f(a.xyz, 4);
let f = vec4f(1, a.yzw);

In others words, d, e, and f are vec4fs, not vec2fs.