Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Issue 7327001: Share shaders between browser compositors. (Closed)

Created:
9 years, 5 months ago by jonathan.backer
Modified:
9 years, 5 months ago
Reviewers:
sky, apatrick_chromium
CC:
chromium-reviews
Visibility:
Public.

Description

Share shaders between browser compositors. Each compositor has it's own context. We should share shaders between them because compiling shaders is expensive. To do this, I pin the very first context created with a ref count. Then I use context sharing to share the shaders. BUG=none TEST=by hand with intel, nv, nouveau, and tegra drivers on a TOUCH_UI build Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91853

Patch Set 1 : "" #

Patch Set 2 : Don't create an extra context. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -18 lines) Patch
M ui/gfx/compositor/compositor_gl.h View 1 chunk +2 lines, -4 lines 0 comments Download
M ui/gfx/compositor/compositor_gl.cc View 1 6 chunks +29 lines, -14 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
jonathan.backer
wjmaclean is on vacation for the next 3 weeks, so I've added apatrick to review ...
9 years, 5 months ago (2011-07-07 20:03:09 UTC) #1
apatrick_chromium
Do all GLs support sharing of shaders between contexts in the same share group? The ...
9 years, 5 months ago (2011-07-07 20:19:41 UTC) #2
sky
I'm rubber stamping LGTM
9 years, 5 months ago (2011-07-07 20:30:23 UTC) #3
jonathan.backer
9 years, 5 months ago (2011-07-08 13:56:49 UTC) #4
On 2011/07/07 20:19:41, apatrick_chromium wrote:
> Do all GLs support sharing of shaders between contexts in the same share
group?

Seems to work on all the driver combos I've tested so far (both GLES and GL).

> If it doesn't work though, one way to avoid compiling shaders multiple times
> would be to compile it from source on one context, read it back as a compiled
> binary and then upload it on the others with glShaderBinary. Looks like that
> approach would work here as well. Just mentioning it.

I investigated. GLES doesn't support binary readback in the core spec. You are
guaranteed to be able to (a) compile form source or (b) load binaries, but not
necessarily both (presumably so that driver vendors can provide an offline
compiler). There is an extension to provide binary readback ---
OES_get_program_binary --- but I don't know how well supported it is.

Powered by Google App Engine
This is Rietveld 408576698