TLDR: BlobAssetReference.Create always copies, performing unneccesary allocations
Whilst I’m not using the ECS itself due to it not fitting my projects needs, for the most part I’m loving the things I now have access to in these new apis. Jobs, BlobAssets, BatchRendererGroup, etc have been awesome.
The access to the internals has been excellent, it’s a relief to just be able to use unmanaged memory and get what I need even if it’s rough around the edges.
One odd outlier though is BlobAssetReference. When creating one it always allocates new memory and takes a copy of the data passed. This is aggrevating as even if I did lay out the memory correctly I have no way to make a BlobAssetReference to it (without ugly hackery).
Currently the api means I load data, have BlobAssetReference copy it, and then I have to free the original so I don’t have two copies around. Also I’ve now got N resources to Dispose later for (seemingly) no benefit.
I understand there are the BlobAssetHeaders, but it feels like we could have a good API which still takes those into account.
Anyway, just a humble request. Thank you so much for these awesome tools.
p.s. To those who would suggest making a custom system: Then I’d have to take on the work to replicate something already existing and which would be incompatible with APIs using BlobAssetReference.