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
Hey! I have seen that BVH::Optimize is now a thing to shortcut the creation of verbose/optimization/conversion back.
The verbose pointer is allocated but never freed. I think it's probably fair to allocate verbose on the stack, convert, and drop it? If someone wants to keep the verbose layout around, they will need to write the conversion themselves (using Optimize, ConvertFrom, etc...).
The text was updated successfully, but these errors were encountered:
I feel like the conversion API is missing a slight differentiation between:
Moved data: The original BVH can be dropped after the converson
Referenced data
This could be "as simple" as having a ConvertFrom that works on r-value references and one on references:
// The verbose one takes ownershipBVH_Verbose::ConvertFrom(BVH&& original);
// Not owned, but then `BVH` must live as long as `BVH_Verbose`.BVH_Verbose::ConvertFrom(const BVH& original);
How would the user differentiate between the two? E.g., what if a conversion for one mesh needs to happen every frame, while another mesh is constructed (and converted) only once? This is expected behavior for GPU BVHs.
Right now I was assuming the 'repeated conversion' scenario, with the 'one shot conversion' as exception, indicated by e.g. a call to 'Compact' (not implemented properly yet). This would also trim all buffers, sort node data for cache coherence and so on.
Hey! I have seen that
BVH::Optimize
is now a thing to shortcut the creation of verbose/optimization/conversion back.The verbose pointer is allocated but never freed. I think it's probably fair to allocate verbose on the stack, convert, and drop it? If someone wants to keep the verbose layout around, they will need to write the conversion themselves (using
Optimize
,ConvertFrom
, etc...).The text was updated successfully, but these errors were encountered: