New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 649204 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Poor texture creation performance with GPU rasterization on Animometer suite > Suits

Project Member Reported by jbau...@chromium.org, Sep 22 2016

Issue description

Based 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.
 

Comment 1 by bsalo...@google.com, Sep 22 2016

Cc: geoffl...@chromium.org
The ANGLE folks encouraged us to switch from BGRA to RGBA on Windows to get better performance. Skia also has some old upload swizzling perf workarounds for D3D9 ANGLE that may be hurting us on D3D11 ANGLE. I'll look at removing those.
Cc: senorblanco@chromium.org bsalomon@chromium.org
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).

Comment 3 by bsalo...@google.com, 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);


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?

Comment 5 by bsalo...@google.com, 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.
Blocking: 643850

Comment 7 by ericrk@chromium.org, Mar 30 2017

Blocking: -643850
bsalomon@, do you remember if any improvements here stuck?


Either way, I don't feel that this is blocking GPU raster on windows.

Comment 8 by bsalo...@google.com, 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.
Project Member

Comment 9 by sheriffbot@chromium.org, Apr 11 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Status: Fixed (was: Untriaged)
I believe this was addressed and since then there have been additional clipping refactors.

Sign in to add a comment