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

Issue 217813004: Make ShaderTranslatorCache thread safe (Closed)

Created:
6 years, 9 months ago by boliu
Modified:
6 years, 8 months ago
CC:
chromium-reviews, piman+watch_chromium.org
Visibility:
Public.

Description

Make ShaderTranslatorCache per thread refcounted After crbug.com/332146 is fixed, in Android WebView, GLES2Decoder can be used on two threads. Make sure a ShaderTranslatorCache instance is only used on a single thread by refcounting an instance between all decoders. Also protect ShInitialize by using the thread safety guarantees of LazyInstance. For tests, a new instance of ShaderTranslatorCache is passed for each ContextGroup. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=261427

Patch Set 1 #

Patch Set 2 : refcount and per-thread cache #

Patch Set 3 : protect ShFinalize #

Total comments: 5

Patch Set 4 : ContextGroup #

Patch Set 5 : Clean up #

Patch Set 6 : mojo TODO #

Patch Set 7 : fix build on linux_gpu #

Patch Set 8 : Fix gpu tests #

Patch Set 9 : NON_EXPORTED_BASE #

Total comments: 1

Patch Set 10 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -50 lines) Patch
M android_webview/browser/hardware_renderer.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M android_webview/browser/hardware_renderer.cc View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_channel_manager.h View 1 3 chunks +3 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_channel_manager.cc View 1 2 chunks +8 lines, -0 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/service/context_group.h View 1 2 3 4 4 chunks +7 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/context_group.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/context_group_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 2 3 4 5 6 7 8 9 4 chunks +17 lines, -5 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.h View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.cc View 1 2 3 3 chunks +18 lines, -6 lines 0 comments Download
M gpu/command_buffer/service/shader_translator.cc View 1 2 3 chunks +14 lines, -16 lines 0 comments Download
M gpu/command_buffer/service/shader_translator_cache.h View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -9 lines 0 comments Download
M gpu/command_buffer/service/shader_translator_cache.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -4 lines 0 comments Download
M gpu/command_buffer/tests/gl_manager.cc View 1 2 3 1 chunk +7 lines, -5 lines 0 comments Download
M gpu/gles2_conform_support/egl/display.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M mojo/services/gles2/command_buffer_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +9 lines, -2 lines 0 comments Download

Messages

Total messages: 48 (0 generated)
boliu
Hmm....any potential perf impact? Maybe we can only lock the initialization and make the cache ...
6 years, 9 months ago (2014-03-29 00:05:45 UTC) #1
boliu
On 2014/03/29 00:05:45, boliu wrote: > Hmm....any potential perf impact? Maybe we can only lock ...
6 years, 9 months ago (2014-03-29 00:13:32 UTC) #2
no sievers
On 2014/03/29 00:13:32, boliu wrote: > On 2014/03/29 00:05:45, boliu wrote: > > Hmm....any potential ...
6 years, 8 months ago (2014-03-31 20:27:38 UTC) #3
no sievers
On 2014/03/31 20:27:38, sievers wrote: > On 2014/03/29 00:13:32, boliu wrote: > > On 2014/03/29 ...
6 years, 8 months ago (2014-03-31 20:30:19 UTC) #4
boliu
On 2014/03/31 20:30:19, sievers wrote: > Actually what's the cost of just having separate translators ...
6 years, 8 months ago (2014-03-31 20:32:37 UTC) #5
boliu
Refcounting the cache and making the cache per thread, kinda big-ish patch now
6 years, 8 months ago (2014-04-02 02:00:12 UTC) #6
boliu
Oh wait, hold off review, still missing actually protecting InitializeShaderTranslator.
6 years, 8 months ago (2014-04-02 02:00:55 UTC) #7
boliu
Ok, now ShInitialize should be safe too. PTAL.
6 years, 8 months ago (2014-04-02 03:15:46 UTC) #8
no sievers
https://codereview.chromium.org/217813004/diff/40001/gpu/command_buffer/service/in_process_command_buffer.h File gpu/command_buffer/service/in_process_command_buffer.h (right): https://codereview.chromium.org/217813004/diff/40001/gpu/command_buffer/service/in_process_command_buffer.h#newcode133 gpu/command_buffer/service/in_process_command_buffer.h:133: virtual gles2::ShaderTranslatorCache* shader_translator_cache() = 0; nit: return scoped_refptr<> https://codereview.chromium.org/217813004/diff/40001/gpu/command_buffer/service/shader_translator_cache.h ...
6 years, 8 months ago (2014-04-02 18:30:19 UTC) #9
boliu
+piman for opinion on whether it's fine for perf to make ShaderTranslatorCache per-ContextGroup rather than ...
6 years, 8 months ago (2014-04-02 21:10:12 UTC) #10
no sievers
On 2014/04/02 21:10:12, boliu wrote: > +piman for opinion on whether it's fine for perf ...
6 years, 8 months ago (2014-04-02 21:27:21 UTC) #11
piman
On 2014/04/02 21:10:12, boliu wrote: > +piman for opinion on whether it's fine for perf ...
6 years, 8 months ago (2014-04-02 21:58:27 UTC) #12
piman
https://codereview.chromium.org/217813004/diff/40001/mojo/services/gles2/command_buffer_impl.cc File mojo/services/gles2/command_buffer_impl.cc (right): https://codereview.chromium.org/217813004/diff/40001/mojo/services/gles2/command_buffer_impl.cc#newcode99 mojo/services/gles2/command_buffer_impl.cc:99: new gpu::gles2::ShaderTranslatorCache, On 2014/04/02 18:30:19, sievers wrote: > We ...
6 years, 8 months ago (2014-04-02 21:58:33 UTC) #13
boliu
Ok, added the TODO in mojo. And previous comments should all be addressed too. PTAL!
6 years, 8 months ago (2014-04-02 22:09:59 UTC) #14
no sievers
LGTM, thanks for fixing this!
6 years, 8 months ago (2014-04-02 22:48:00 UTC) #15
boliu
+viettrungluu for mojo owners
6 years, 8 months ago (2014-04-02 23:00:06 UTC) #16
viettrungluu
mojo OWNERS lgtm
6 years, 8 months ago (2014-04-02 23:03:42 UTC) #17
boliu
The CQ bit was checked by boliu@chromium.org
6 years, 8 months ago (2014-04-02 23:05:50 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/217813004/100001
6 years, 8 months ago (2014-04-02 23:09:28 UTC) #19
boliu
The CQ bit was unchecked by boliu@chromium.org
6 years, 8 months ago (2014-04-02 23:22:20 UTC) #20
boliu
Heh, missed a compile error even though I built All on linux. Turns out linux_gpu ...
6 years, 8 months ago (2014-04-03 00:13:33 UTC) #21
no sievers
On 2014/04/03 00:13:33, boliu wrote: > Heh, missed a compile error even though I built ...
6 years, 8 months ago (2014-04-03 00:45:37 UTC) #22
boliu
On 2014/04/03 00:45:37, sievers wrote: > how about making the cache unregister itself as destruction ...
6 years, 8 months ago (2014-04-03 01:06:16 UTC) #23
no sievers
lgtm
6 years, 8 months ago (2014-04-03 01:07:53 UTC) #24
boliu
The CQ bit was checked by boliu@chromium.org
6 years, 8 months ago (2014-04-03 01:08:32 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/217813004/130001
6 years, 8 months ago (2014-04-03 01:10:59 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-03 02:09:39 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on mac_chromium_rel
6 years, 8 months ago (2014-04-03 02:09:40 UTC) #28
boliu
The CQ bit was checked by boliu@chromium.org
6 years, 8 months ago (2014-04-03 04:32:35 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/217813004/150001
6 years, 8 months ago (2014-04-03 04:35:16 UTC) #30
piman
lgtm https://codereview.chromium.org/217813004/diff/150001/gpu/command_buffer/service/gles2_cmd_decoder.cc File gpu/command_buffer/service/gles2_cmd_decoder.cc (right): https://codereview.chromium.org/217813004/diff/150001/gpu/command_buffer/service/gles2_cmd_decoder.cc#newcode3419 gpu/command_buffer/service/gles2_cmd_decoder.cc:3419: // Need to release these before releasing |group_| ...
6 years, 8 months ago (2014-04-03 05:55:09 UTC) #31
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-03 10:12:25 UTC) #32
commit-bot: I haz the power
Commit queue rejected this change because the description was changed between the time the change ...
6 years, 8 months ago (2014-04-03 10:12:25 UTC) #33
boliu
The CQ bit was checked by boliu@chromium.org
6 years, 8 months ago (2014-04-03 12:01:55 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/217813004/170001
6 years, 8 months ago (2014-04-03 12:03:07 UTC) #35
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-03 12:08:32 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_compile_dbg
6 years, 8 months ago (2014-04-03 12:08:32 UTC) #37
boliu
The CQ bit was checked by boliu@chromium.org
6 years, 8 months ago (2014-04-03 12:09:52 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/217813004/170001
6 years, 8 months ago (2014-04-03 12:10:24 UTC) #39
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-03 12:55:08 UTC) #40
commit-bot: I haz the power
Retried try job too often on ios_rel_device_ninja for step(s) compile http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_rel_device_ninja&number=9497
6 years, 8 months ago (2014-04-03 12:55:09 UTC) #41
boliu
The CQ bit was checked by boliu@chromium.org
6 years, 8 months ago (2014-04-03 13:07:38 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/217813004/170001
6 years, 8 months ago (2014-04-03 13:07:41 UTC) #43
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-03 15:37:13 UTC) #44
commit-bot: I haz the power
Commit queue rejected this change because the description was changed between the time the change ...
6 years, 8 months ago (2014-04-03 15:37:14 UTC) #45
boliu
The CQ bit was checked by boliu@chromium.org
6 years, 8 months ago (2014-04-03 15:38:31 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/217813004/170001
6 years, 8 months ago (2014-04-03 15:39:10 UTC) #47
commit-bot: I haz the power
6 years, 8 months ago (2014-04-03 15:58:15 UTC) #48
Message was sent while issue was closed.
Change committed as 261427

Powered by Google App Engine
This is Rietveld 408576698