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
I'm hitting the issue where I want to implement ShaderType over a struct that has a [u16; 2] field, which isn't supported by Encase.
AFAIU seeing that WGSL doesn't, it makes sense. The way I make this currently work is by representing [u16; 2] as a u32 in WGSL and then unpack it into a vec2<u32>.
Is this in scope for Encase?
The text was updated successfully, but these errors were encountered:
The problem I see with implementing ShaderType for [u16; 2] right now is that we might get an extension in the future which will enable the usage of u16 types. If that happens, the [u16; 2] could be interpreted as both a packed u32 or an array of 2 u16s.
I would recommend users create newtypes for packed scalars with their own ShaderType implementation.
encase could provide helper macros that derive those implementations and/or these newtypes directly, but the question then becomes how should those types look like/what is their API?
I'm hitting the issue where I want to implement
ShaderType
over a struct that has a[u16; 2]
field, which isn't supported by Encase.AFAIU seeing that WGSL doesn't, it makes sense. The way I make this currently work is by representing
[u16; 2]
as au32
in WGSL and then unpack it into avec2<u32>
.Is this in scope for Encase?
The text was updated successfully, but these errors were encountered: