encase
encase copied to clipboard
Support variable-sized arrays in uniform buffers via `arrayvec::ArrayVec`/`tinyvec::ArrayVec`
Since the arrayvec::ArrayVec
/tinyvec::ArrayVec
types have a hard cap on the items they contain, the capacity can be used on the shader side as the fixed-size array length.
Besides being able to use these Vec
-like data structures, this will also allow this trick to work (we should however note somewhere that reading beyond the actual length of items that were written will effectively return garbage data).