Wgpu: [u32; 16]

Is it possible to do something like:

    @location(0) bit_map: array<u32, 16>,
    @location(4) blk0: array<u32, 16>,

    @location(8) blk1: array<u32, 16>,
};

in wgsl/wgpu ?

why do you want this ?

I'm encoding some data into the vertex attribs and I want to index into them

why not 4 vec<u32> ?

I can't index into it

why not a mat4x4<u32> ?

It only supports mat4x4<f32>

Thanks!

1 Like

Not according to the spec:

Each user-defined input datum and user-defined output datum must:


You can, however, ship the values to the shader as 4 vec4us, and then construct an array from their components inside the shader.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.