Best Practices Skia GPU Performance

1,431 views
Skip to first unread message

Corey Lucier

unread,
Aug 9, 2018, 2:17:03 PM8/9/18
to skia-discuss
Is there any documentation on Skia Ganesh (GPU) best practices?

We recently tried switching from our parallel tile renderer to Skia GPU but seeing a general slow down.  Currently mostly texture upload per frame.

Are there any tricks to rendering with large raster images to avoid upload each time we render with them? For example if we are using SkBitmap instead of SkImage is that a gotcha? 

Thanks,

Corey

Mike Reed

unread,
Aug 9, 2018, 2:27:24 PM8/9/18
to skia-d...@googlegroups.com
SkBitmap (in general) is not your friend.

If you can always package your images using SkImage, things will get better (or at least clearer).
- SkImage is always immutable
- Uploaded images are cached (see Ganesh's cache budget)
- You can decide to explicitly convert your image to a gpu-backed image
   - this guarantees that it will never get purged, so always draws fastest
   - you have to take this into account, as you are now part of the budgeting piece of managing gpu memory
- Images are the natural way to turn an offscreen rendering into a drawing image
   - SkSurface -> makeImageSnapshot()
- Surfaces (offscreen drawing contexts) can be explicitly gpu-backed, making it zero-cpu-copy to draw offscreen and turn that into an image/texture

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Corey Lucier

unread,
Aug 9, 2018, 2:38:16 PM8/9/18
to skia-discuss
Thanks Mike (or anyone else). Any other general or high level tips for improving GPU backend perf?
Reply all
Reply to author
Forward
0 new messages