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)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
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•3 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•3 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•3 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•3 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.
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a80d39128a7c Rename ArrayAllocationTracker into GuillotineAllocator. r=gw https://hg.mozilla.org/integration/autoland/rev/59243c485fc8 Move the slab allocator code out of texture_cache.rs. r=gw https://hg.mozilla.org/integration/autoland/rev/5664e73089cf Rename TextureUnit into SlabAllocator. r=gw https://hg.mozilla.org/integration/autoland/rev/7051f98f3fb0 Use an alloc ID instead of origin + region index. r=gw
Assignee | ||
Updated•3 years ago
|
Comment 6•3 years ago
|
||
bugherder |
Assignee | ||
Comment 7•3 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•3 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•3 years ago
|
||
Depends on D98654
Assignee | ||
Comment 10•3 years ago
|
||
It is dead code now that glyphs use a shelf allocator.
Depends on D98655
Assignee | ||
Comment 11•3 years ago
|
||
Depends on D98656
Assignee | ||
Comment 12•3 years ago
|
||
Depends on D98657
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 13•3 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•3 years ago
|
||
Comment 15•3 years ago
|
||
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f1473ccab3f4 Move more atlas allocation logic out of texture_cache.rs. r=gw
Updated•3 years ago
|
Comment 16•3 years ago
|
||
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c72e9061894f Use a shelf packing allocator for the glyph atlas. r=gw https://hg.mozilla.org/integration/autoland/rev/1c0e0610062a Remove glyph-specific slab sizes. r=gw https://hg.mozilla.org/integration/autoland/rev/8a727f82c0bb Run Mach vendor rust. r=gw
Assignee | ||
Comment 17•3 years ago
|
||
Comment 18•3 years ago
|
||
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5bef00913f8c Adjust wrench reftest reference (after glyph atlas changes). r=jrmuizel
Comment 19•3 years ago
|
||
bugherder |
Assignee | ||
Comment 20•3 years ago
|
||
Comment 21•3 years ago
|
||
bugherder |
Comment 22•3 years ago
|
||
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9161ce15f453 Use a shelf packing allocator for the image atlas. r=gw. https://hg.mozilla.org/integration/autoland/rev/007cb36f75ef Use the shelf allocator for alpha8_linear and color8_nearest textures. r=gw https://hg.mozilla.org/integration/autoland/rev/9be34a5d74d6 Adjust reftest references. r=gw
Assignee | ||
Comment 23•3 years ago
|
||
Assignee | ||
Comment 24•3 years ago
|
||
Once again, Android 8.0 Pixel2 debug being hidden in fuzzy queries means we don't see see them break.
Comment 25•3 years ago
|
||
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6683c4e0bc96 Fix reftest syntax error. r=jnicol https://hg.mozilla.org/integration/autoland/rev/a6b10fddf201 More reftest adjustments. r=jnicol
Assignee | ||
Comment 26•3 years ago
|
||
Comment 27•3 years ago
|
||
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c250273ad967 More android 8 reftest fuzziness adjustments. r=jnicol
Assignee | ||
Comment 28•3 years ago
|
||
Comment 29•3 years ago
|
||
bugherder |
Comment 30•3 years ago
|
||
Pushed by dluca@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d7c981ef38fc Fix cargo test build. r=jnicol. CLOSED TREE
Assignee | ||
Updated•3 years ago
|
Comment 31•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Description
•