Move some of the texture cache atlases to a shelf allocator
Categories
(Core :: Graphics: WebRender, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: nical, Assigned: nical)
References
(Blocks 1 open bug)
Details
Attachments
(16 files, 1 obsolete file)
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details |
Following up from 1674443, we can provide big improvements to glyph packing by moving to a tighter allocation strategy. I experimented with several and the one that gave the best performance/packing/fragmentation compromise for glyphs was a bucketed shelf packing allocation strategy implemented in https://docs.rs/etagere/0.2.1/etagere/struct.BucketedAtlasAllocator.html
Assignee | ||
Comment 1•4 years ago
|
||
I'm about to add a couple of new atlas allocation algorithms. This patch renames one of the existing one into something less generic before it gets confusing.
Also fix outdated comments about merging and dynamic allocation which was removed a while ago.
Assignee | ||
Comment 2•4 years ago
|
||
A bit of cleanup and a step towards having more allocation algorithms in the texture cache. This patch mostly moves code around, and should not change the behavior of the code.
Depends on D98201
Assignee | ||
Comment 3•4 years ago
|
||
And move texture_id into a TextureUnit structure in the texture_cache.rs that contains the allocator and the id. No behavior changes in this patch.
Depends on D98202
Assignee | ||
Comment 4•4 years ago
|
||
Another step towards abstracting out slab allocation from the rest of the texture cache and allowing multiple algorithms. All dynamic atlas allocation algorithms will use an AllocId encoded into 32 bits.
Assignee | ||
Updated•4 years ago
|
Comment 6•4 years ago
|
||
bugherder |
Assignee | ||
Comment 7•4 years ago
|
||
This commit moves the code that deals with allocating into a dynamic amount of textures (TextureUnits) out of texture_cache.rs, rename it into AllocatorList and make it generic.
The code also changes some of the profile counters to count pixels and number of textures instead of number of regions and size in bytes.
I had to introduce two traits which is a bit cumbersome but not so bad. AtlasAllocator is needed to implement AllocatorList with multiple allocators and AtlasAllocatorList is a dyn trait to let the texture cache can select between allocator lists of different type signatures.
Assignee | ||
Comment 8•4 years ago
|
||
Probably because of a newer version of the compiler, doing this before evoids adding a lot of unrelated changes to the interesting patches.
Depends on D98371
Assignee | ||
Comment 9•4 years ago
|
||
Depends on D98654
Assignee | ||
Comment 10•4 years ago
|
||
It is dead code now that glyphs use a shelf allocator.
Depends on D98655
Assignee | ||
Comment 11•4 years ago
|
||
Depends on D98656
Assignee | ||
Comment 12•4 years ago
|
||
Depends on D98657
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 13•4 years ago
|
||
I had a look at the alpha8 texture which tends to allocate two 1024x1024 textures with the slab allocator. We end needing a second texture because we have more than 4 slab sizes, but the regions tend to be mostly empty. Using the shelf allocator works a lot better. So much so that I was almost tempted to use a 512x512 texture with the shelf allocator but we end up allocating two of them after a few minutes. two 512x512 textures consumes half of the memory, but leads to more batch breaks so I'll conservatively settle for a single 1024x1024 shelf allocated texture.
For pop-up windows we could use 512x512 alpha8 linear textures, though.
Assignee | ||
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
Updated•4 years ago
|
Comment 16•4 years ago
|
||
Assignee | ||
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
Comment 19•4 years ago
|
||
bugherder |
Assignee | ||
Comment 20•4 years ago
|
||
Comment 21•4 years ago
|
||
bugherder |
Comment 22•4 years ago
|
||
Assignee | ||
Comment 23•4 years ago
|
||
Assignee | ||
Comment 24•4 years ago
|
||
Once again, Android 8.0 Pixel2 debug being hidden in fuzzy queries means we don't see see them break.
Comment 25•4 years ago
|
||
Assignee | ||
Comment 26•4 years ago
|
||
Comment 27•4 years ago
|
||
Assignee | ||
Comment 28•4 years ago
|
||
Comment 29•4 years ago
|
||
bugherder |
Comment 30•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Comment 31•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Updated•4 years ago
|
Description
•