Poor texture creation performance with GPU rasterization on Animometer suite > Suits |
||||||
Issue descriptionBased on an ETW trace, about 20% of the time is spent allocating and clearing textures. Maybe we could improve skia's texture cache somehow to avoid that.
,
Sep 23 2016
Is something supposed to remove the unique key of alpha clip mask textures so they can be recycled? GrResourceCache::fScratchMap seems to have around 6 textures in it, while fUniqueHash has around 8000 (and its fDeleted is 55000).
,
Sep 23 2016
Textures are supposed to be made available for reuse if they're not used by their unique key for some period of time. However, we were a bit too aggressive and I recently (yesterday) increased the threshold by a large factor. It was previously ~1 second, which was too aggressive for some canvas2d scenarios. Now it may take ~30 seconds before a texture loses association with its unique key. This is a knob we could expose. One idea is an API something like this: uint32_t purgeMarker = context->setResourceCacheMark(); // some number of frames or amount time later: context->purgeResourcesUnusedSinceMark(purgeMarker);
,
Sep 23 2016
Ok, I just tried commenting out "result->resourcePriv().setUniqueKey(key);" in GrClipStackClip::CreateSoftwareClipMask and GrClipStackClip::CreateAlphaClipMask, and that improved the score from 84 to 530 (software is 600). Also, as far as I can tell your change yesterday only deals with purging textures (and resource->cacheAccess().release() is what deletes the textures), not with removing unique keys from them. Is there some other relevant code that removes unique keys but doesn't destroy the texture?
,
Sep 26 2016
You're actually right that we don't remove the unique key. We could probably modify the cache so that it removes the unique key before trashing it. There is another problem related to this test. The clip paths get transformed to device space by SkCanvas/SkClipStack. Each transformation yields a new path. This means they don't wind up getting cached. I'm starting to look at storing them in src space along with a matrix.
,
Oct 1 2016
,
Mar 30 2017
bsalomon@, do you remember if any improvements here stuck? Either way, I don't feel that this is blocking GPU raster on windows.
,
Mar 31 2017
I added a mechanism that purges the clip masks as soon as the stack of clips is popped and they are no longer reachable. So we should be getting much better texture reuse here.
,
Apr 11 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 11 2018
I believe this was addressed and since then there have been additional clipping refactors. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by bsalo...@google.com
, Sep 22 2016