Skip to content

Rework meta type system

Since we want the user to use "Rust" types we need a way to reliably translate those types to spirv type-ids. Currently this is done directly on the Serializer type like this: serializer.type_f32().

This worked at first, but becomes limiting when working with structs and arrays.

A better approach might be to extend the IntoSpvType trait into a AsSpvType trait that not only allows translation into SpvType, but also allows to retrieve the types-id via like this <f32 as AsSpvType>::spv_type_id(&mut serializer).

This way structs could implement AsSpvType and could be used like any other type. This would also open the way for a DeriveAsSpvType macro.