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
This works but is probably the wrong fix. I don't know three.js
that well so I thought I'd post this as an example of a fix
and it might lead to the correct fix.
The issue is WebGPU does not support itemSize = 1 or itemSize = 3
for 8bit or 16bit values.
When using KHR_mesh_quantization some attributes are like Int16x3.
But, according to the KHR_mesh_quantization spec they are actually
padded to Int16x4
In WebGL it's fine to set the attribute to
```
size = 3, type = gl.SHORT, normalize = true, stride = 8.
```
But in WebGPU there is no such thing as
`size = 3, type = gl.SHORT`
If it existed it would be called `sint16x3` or `uint16x3` or
`snorm16x3` or `unorm16x3` but none of those exist. Instead
you have to set the attribute to `???x4` for these situations.
You then need to be careful the shader doesn't actually use Z.
The shader can still declare its attribute has vec3f/vec3<f32>
but if it declares it as vec4/vec4<f32> the z value would be
undefined (whatever happens to be in the file in the padding)
My guess is the correct fix, rather than this hack which expands
the type, it should look at the stride. The stride to figure
out when to expand the type from x3 to x4 or from x1 to x2
or x1 to x4
0 commit comments