webgpu / webgpufundamentals

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

confusion with data types #126

Closed KTibow closed 2 months ago

KTibow commented 2 months ago

https://webgpufundamentals.org/webgpu/lessons/webgpu-fundamentals.html#a-run-computations-on-the-gpu

the code snippets use vec3u (doesn't work) the code demo uses vec3<u32> (works)

which one's proper?

greggman commented 2 months ago

vec3u works

https://jsgist.org/?src=990b3091ae56a65364d70162b9189a1d

maybe you had a typo? Or are using a really old browser? As for which, they're both fine

https://webgpufundamentals.org/webgpu/lessons/webgpu-wgsl.html

KTibow commented 2 months ago

that's odd, i swear i copied the code verbatim and it gave me empty values with vec3u (maybe it was an issue with my hot reload?)

anyway, i tried again and am no longer having this problem, so i will close the issue.