by sfink · 2y ago · 0 comments
If so, then could you do a fast but messy allocation, then clean it up when you run out of space, or are about to? Or you could pull in more traditional GC tricks: have one texture that gradually accumulates long-lived images (the tenured region), and divide up another region into two semispaces that you do fast bump-like allocations into and then compact from one to the other when it fills up. You could even incrementally repack, assume copying within and between atlases works in the first place.
We also made heavy use of allocation bitmaps and a few other tricks to ensure that the texture allocator does zero dynamic memory allocation at runtime, as that could cause performance bubbles.
Since it's device local it takes almost no time.