brendan-duncan/wgsl_reflect

Needs support for `alias`

Closed this issue · 2 comments

example

        alias material_index = u32;
        alias color = vec3f;

        struct material {
            index: material_type,
            diffuse: color,
        }

        @group(0) @binding(1) var<storage> materials: array<material>;

reflect returns nothing for this

WgslReflect {structs: Array(0), uniforms: Array(0), storage: Array(0), textures: Array(0), samplers: Array(0), …}
aliases: []
ast: []
entry: EntryFunctions
  compute: []
  fragment: []
  vertex: []
samplers: []
storage: []
structs: []
textures: []
uniforms: []

I guess I missed the memo, but did the keyword type get renamed to alias, or are those separate things. It looks like type got moved to the reserved list, so I'm guessing it was renamed.

I pushed a change to use alias instead of type. In your example, aliases now has two entries, which are AST Alias objects.

I think this one is completed. If I missed some details, feel free to open a new issue.