Commands are currently working very directly with pointers & pointer data. This has already led to one difficult-to-track-down bug where component ids were being set as u16s but read as u32s. Using structs for commands and yielding those when iterating would make this would prevent differences in read/write types, and just be a lot cleaner overall.
Some additional thoughts:
This could make it pretty easy to create a consumer-facing custom commands API in the future.
Currently the same command can have different sizes, which is not permitted for structs.
Could require these to Box their contents, but this makes command data non-contiguous and requires a fair amount of additional work for the allocator
Allow command size and struct size to mismatch. Kind of odd, but it might make sense in this case?
Commands are currently working very directly with pointers & pointer data. This has already led to one difficult-to-track-down bug where component ids were being set as u16s but read as u32s. Using structs for commands and yielding those when iterating would make this would prevent differences in read/write types, and just be a lot cleaner overall.
Some additional thoughts:
Box
their contents, but this makes command data non-contiguous and requires a fair amount of additional work for the allocator