Initialize the GPU shader disk cache in the browser.
The disk cache allows us to load the compositor shaders on startup,
saving quite a bit of time on platforms that support caching.
BUG=510151
Committed: https://crrev.com/57b52d4786d8262c07e7eb5ba3a55cabf801ebff
Cr-Commit-Position: refs/heads/master@{#344816}
+piman, danakj and enne; I don't have experience with the browser compositor and its setup. ...
5 years, 4 months ago
(2015-08-06 01:01:01 UTC)
#4
+piman, danakj and enne; I don't have experience with the browser compositor and
its setup.
https://codereview.chromium.org/1274763003/diff/1/content/browser/gpu/browser...
File content/browser/gpu/browser_gpu_channel_host_factory.cc (right):
https://codereview.chromium.org/1274763003/diff/1/content/browser/gpu/browser...
content/browser/gpu/browser_gpu_channel_host_factory.cc:157: user_data_dir);
Something seems suspicious about this. GpuChannels mostly map 1:1 to renderer
processes. This is going to be called once per each renderer process that
attempts to communicate with the GPU process, which seems wrong.
RenderProcessHostImpl::RenderProcessHostImpl already sets up the shader cache
for every spawned renderer.
As far as I understand the problem, the GpuChannels that the browser compositor
creates are the ones that don't have the shader disk cache set up properly. I
think we need to track down the code path that initializes those GpuChannels
specifically.
piman
https://codereview.chromium.org/1274763003/diff/1/content/browser/gpu/browser_gpu_channel_host_factory.cc File content/browser/gpu/browser_gpu_channel_host_factory.cc (right): https://codereview.chromium.org/1274763003/diff/1/content/browser/gpu/browser_gpu_channel_host_factory.cc#newcode157 content/browser/gpu/browser_gpu_channel_host_factory.cc:157: user_data_dir); On 2015/08/06 01:01:01, Ken Russell wrote: > Something ...
5 years, 4 months ago
(2015-08-06 19:53:13 UTC)
#5
https://codereview.chromium.org/1274763003/diff/1/content/browser/gpu/browser...
File content/browser/gpu/browser_gpu_channel_host_factory.cc (right):
https://codereview.chromium.org/1274763003/diff/1/content/browser/gpu/browser...
content/browser/gpu/browser_gpu_channel_host_factory.cc:157: user_data_dir);
On 2015/08/06 01:01:01, Ken Russell wrote:
> Something seems suspicious about this. GpuChannels mostly map 1:1 to renderer
> processes. This is going to be called once per each renderer process that
> attempts to communicate with the GPU process, which seems wrong.
> RenderProcessHostImpl::RenderProcessHostImpl already sets up the shader cache
> for every spawned renderer.
>
> As far as I understand the problem, the GpuChannels that the browser
compositor
> creates are the ones that don't have the shader disk cache set up properly. I
> think we need to track down the code path that initializes those GpuChannels
> specifically.
FYI, this code path is to setup the GpuChannelHost for the browser - it's the
equivalent of what RenderThreadImpl::EstablishGpuChannelSync does in the
renderer. gpu_client_id_ is the channel id for the browser.
This is going to be called once per GPU process restart though. It seems like an
odd place to put it. Maybe instead you could post a task to the IO thread from
the BrowserGpuChannelHostFactory constructor, only once?
Jamie Madill
PTAL - think this is mostly ready for review, just looking at making a browser ...
5 years, 4 months ago
(2015-08-07 19:06:40 UTC)
#6
PTAL - think this is mostly ready for review, just looking at making
a browser test now.
On 2015/08/06 19:53:13, piman (Very slow to review) wrote:
>
https://codereview.chromium.org/1274763003/diff/1/content/browser/gpu/browser...
> File content/browser/gpu/browser_gpu_channel_host_factory.cc (right):
>
>
https://codereview.chromium.org/1274763003/diff/1/content/browser/gpu/browser...
> content/browser/gpu/browser_gpu_channel_host_factory.cc:157: user_data_dir);
> On 2015/08/06 01:01:01, Ken Russell wrote:
> > Something seems suspicious about this. GpuChannels mostly map 1:1 to
renderer
> > processes. This is going to be called once per each renderer process that
> > attempts to communicate with the GPU process, which seems wrong.
> > RenderProcessHostImpl::RenderProcessHostImpl already sets up the shader
cache
> > for every spawned renderer.
> >
> > As far as I understand the problem, the GpuChannels that the browser
> compositor
> > creates are the ones that don't have the shader disk cache set up properly.
I
> > think we need to track down the code path that initializes those GpuChannels
> > specifically.
>
> FYI, this code path is to setup the GpuChannelHost for the browser - it's the
> equivalent of what RenderThreadImpl::EstablishGpuChannelSync does in the
> renderer. gpu_client_id_ is the channel id for the browser.
Correct, this should only happen in the browser process, not the Renderers.
> This is going to be called once per GPU process restart though. It seems like
an
> odd place to put it. Maybe instead you could post a task to the IO thread from
> the BrowserGpuChannelHostFactory constructor, only once?
Done, seems reasonable.
piman
https://codereview.chromium.org/1274763003/diff/20001/content/browser/gpu/browser_gpu_channel_host_factory.cc File content/browser/gpu/browser_gpu_channel_host_factory.cc (right): https://codereview.chromium.org/1274763003/diff/20001/content/browser/gpu/browser_gpu_channel_host_factory.cc#newcode249 content/browser/gpu/browser_gpu_channel_host_factory.cc:249: base::Unretained(this))); Unretained seems unsafe. How about testing the command ...
5 years, 4 months ago
(2015-08-07 19:33:59 UTC)
#7
PTAL. https://codereview.chromium.org/1274763003/diff/20001/content/browser/gpu/browser_gpu_channel_host_factory.cc File content/browser/gpu/browser_gpu_channel_host_factory.cc (right): https://codereview.chromium.org/1274763003/diff/20001/content/browser/gpu/browser_gpu_channel_host_factory.cc#newcode249 content/browser/gpu/browser_gpu_channel_host_factory.cc:249: base::Unretained(this))); On 2015/08/07 19:33:59, piman (Very slow to ...
5 years, 4 months ago
(2015-08-07 20:07:58 UTC)
#8
PTAL.
https://codereview.chromium.org/1274763003/diff/20001/content/browser/gpu/bro...
File content/browser/gpu/browser_gpu_channel_host_factory.cc (right):
https://codereview.chromium.org/1274763003/diff/20001/content/browser/gpu/bro...
content/browser/gpu/browser_gpu_channel_host_factory.cc:249:
base::Unretained(this)));
On 2015/08/07 19:33:59, piman (Very slow to review) wrote:
> Unretained seems unsafe.
>
> How about testing the command line and grabbing the directory here, and
posting
> the task only if we need to, passing the directory and the client id by value?
> Then the function to set the cache info doesn't need |this| and can be static.
Done.
piman
lgtm
5 years, 4 months ago
(2015-08-07 20:19:03 UTC)
#9
lgtm
jam
https://codereview.chromium.org/1274763003/diff/40001/content/public/browser/content_browser_client.h File content/public/browser/content_browser_client.h (right): https://codereview.chromium.org/1274763003/diff/40001/content/public/browser/content_browser_client.h#newcode517 content/public/browser/content_browser_client.h:517: // Returns the path to the browser shader disk ...
5 years, 4 months ago
(2015-08-07 20:41:04 UTC)
#10
Realizing that I misunderstood the semantics of BrowserGpuChannelHostFactory in the earlier patch, LGTM modulo John's ...
5 years, 4 months ago
(2015-08-07 22:47:41 UTC)
#11
Realizing that I misunderstood the semantics of BrowserGpuChannelHostFactory in
the earlier patch, LGTM modulo John's comments.
Jamie Madill
PTAL. Still thinking about how to add a test, might need help on that. https://codereview.chromium.org/1274763003/diff/40001/content/public/browser/content_browser_client.h ...
5 years, 4 months ago
(2015-08-10 17:18:00 UTC)
#12
PTAL. Still thinking about how to add a test, might need help on that.
https://codereview.chromium.org/1274763003/diff/40001/content/public/browser/...
File content/public/browser/content_browser_client.h (right):
https://codereview.chromium.org/1274763003/diff/40001/content/public/browser/...
content/public/browser/content_browser_client.h:517: // Returns the path to the
browser shader disk cache root.
On 2015/08/07 20:41:04, jam wrote:
> nit: please make chrome return a path that includes the shader directory (i.e.
> not root = udd). i would like to avoid sending udd directly to content module
to
> avoid layering violations with content mucking with chrome's files
Done.
jam
lgtm sorry for the delay, i didn't see your reply
5 years, 4 months ago
(2015-08-17 16:21:17 UTC)
#13
lgtm sorry for the delay, i didn't see your reply
Jamie Madill
PTAL. After speaking to sievers@, Made a change so the Android content_unittests wouldn't fail due ...
5 years, 4 months ago
(2015-08-21 12:09:42 UTC)
#14
PTAL. After speaking to sievers@, Made a change so the Android content_unittests
wouldn't fail due to trying to initialize the GPU host without a content client.
piman
LGTM if sievers@ is ok with this.
5 years, 4 months ago
(2015-08-21 17:37:46 UTC)
#15
LGTM if sievers@ is ok with this.
Ken Russell (switch to Gerrit)
LGTM again too FWIW.
5 years, 4 months ago
(2015-08-21 18:03:42 UTC)
#16
LGTM again too FWIW.
no sievers
On 2015/08/21 17:37:46, piman (slow to review) wrote: > LGTM if sievers@ is ok with ...
5 years, 4 months ago
(2015-08-21 18:08:23 UTC)
#17
On 2015/08/21 17:37:46, piman (slow to review) wrote:
> LGTM if sievers@ is ok with this.
yes lgtm
Jamie Madill
Great, going to land this!
5 years, 4 months ago
(2015-08-21 18:09:10 UTC)
#18
Great, going to land this!
Jamie Madill
The CQ bit was checked by jmadill@chromium.org
5 years, 4 months ago
(2015-08-21 18:09:15 UTC)
#19
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1274763003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1274763003/80001
5 years, 4 months ago
(2015-08-21 18:09:48 UTC)
#21
Issue 1274763003: Initialize GPU shader disk cache on brower thread.
(Closed)
Created 5 years, 4 months ago by Jamie Madill
Modified 5 years, 4 months ago
Reviewers: jam, Ken Russell (switch to Gerrit), piman, danakj, enne (OOO)
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 6