brendan-duncan / wgsl_reflect

A WebGPU Shading Language parser and reflection library for Javascript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

missing members?

greggman opened this issue · comments

If I take the shader in this test

const shader = `alias material_index = u32;

Which is this

alias material_index = u32;
alias color = vec3f;
struct material {
    index: material_type,
    diffuse: color,
}
@group(0) @binding(1) var<storage> materials: array<material>;

Then I make a WgslReflect

 const reflect = new WgslReflect(code);

and I look at the result it looks good.

Screenshot 2023-04-17 at 16 29 14

But then I call

 const info = reflect.getStructInfo(relect.structs[0);

and that's missing a member

Screenshot 2023-04-17 at 16 30 31

actually it's just a typo in the shader