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

Issue 7253052: Execute all GL commands up to the put offset reported by a flush. (Closed)

Created:
9 years, 5 months ago by apatrick_chromium
Modified:
9 years, 5 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., Ken Russell (switch to Gerrit)
Visibility:
Public.

Description

Execute all GL commands up to the put offset reported by a each flush.This means glFlush is a barrier that prevents reordering of GL commands issued on different command buffers. I used it to replace latches for synchronizing the rendering of WebGL canvas and Pepper 3D with the accelerated compositor. The primary advantage is it is more robust than latches and there is no possibility of deadlock. It should also be possible for WebGL and Pepper 3D to use it whereas exposing SetLatch and WaitLatch would be dangerous.The calls to SetLatch and WaitLatch are still in webkit but they are no-ops. SetLatch and WaitLatch are completely removed elsewhere.I changed CommandBuffer::FlushSync to Finish to reflect the new semantics. Going forward, I will add a synchronous CommandBuffer::WaitForToken and WaitForAvailableEntries, which should eliminate the need to call Finish unless glFinish is called by the client. The Pepper interface is unchanged because I don't want to break binary compatibility.I fixed a bug where the last read token in CmdBufferHelper was stale after receiving a ReportState IPC. That was causing a redundant synchronous flush in the client side SwapBuffers throttling.I removed Yield because it does not make sense with the new semantics. There is no round robin scheduling.Tested with WebGL on Windows and Mac and checked that 72672 did not regress. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=93066

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 11

Patch Set 9 : '' #

Patch Set 10 : '' #

Patch Set 11 : '' #

Total comments: 2

Patch Set 12 : '' #

Total comments: 2

Patch Set 13 : '' #

Patch Set 14 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+336 lines, -773 lines) Patch
M content/common/gpu/gpu_channel.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +19 lines, -3 lines 0 comments Download
M content/common/gpu/gpu_channel.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +102 lines, -27 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +4 lines, -7 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +49 lines, -68 lines 0 comments Download
M content/common/gpu/gpu_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -1 line 0 comments Download
M content/renderer/gpu/command_buffer_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +1 line, -5 lines 0 comments Download
M content/renderer/gpu/command_buffer_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -6 lines 0 comments Download
M gpu/command_buffer/build_gles2_cmd_buffer.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +0 lines, -10 lines 0 comments Download
M gpu/command_buffer/client/cmd_buffer_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +7 lines, -12 lines 0 comments Download
M gpu/command_buffer/client/cmd_buffer_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +7 lines, -22 lines 0 comments Download
M gpu/command_buffer/client/cmd_buffer_helper_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -6 lines 0 comments Download
M gpu/command_buffer/client/fenced_allocator_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/client/gles2_c_lib_autogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -6 lines 0 comments Download
M gpu/command_buffer/client/gles2_cmd_helper_autogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -10 lines 0 comments Download
M gpu/command_buffer/client/gles2_demo.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -3 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -1 line 0 comments Download
M gpu/command_buffer/client/gles2_implementation_autogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -10 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -1 line 0 comments Download
M gpu/command_buffer/client/mapped_memory_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/client/ring_buffer_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/common/cmd_buffer_common.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +0 lines, -27 lines 0 comments Download
M gpu/command_buffer/common/command_buffer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -7 lines 0 comments Download
M gpu/command_buffer/common/command_buffer_mock.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M gpu/command_buffer/common/constants.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -18 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format_autogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -68 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format_test_autogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -26 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_ids_autogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -2 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/cmd_parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/cmd_parser_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -24 lines 0 comments Download
M gpu/command_buffer/service/command_buffer_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +3 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/command_buffer_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +7 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/common_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -6 lines 0 comments Download
M gpu/command_buffer/service/common_decoder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -6 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -5 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +0 lines, -63 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -59 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_2_autogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -2 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/gpu_scheduler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +11 lines, -24 lines 0 comments Download
M gpu/command_buffer/service/gpu_scheduler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +58 lines, -106 lines 0 comments Download
M gpu/command_buffer/service/gpu_scheduler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 8 chunks +10 lines, -52 lines 0 comments Download
M gpu/command_buffer/service/mocks.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -14 lines 0 comments Download
M gpu/command_buffer/service/mocks.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -19 lines 0 comments Download
M gpu/demos/framework/window.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -1 line 0 comments Download
M gpu/gles2_conform_support/egl/display.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -1 line 0 comments Download
M ppapi/proxy/ppb_context_3d_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -0 lines 0 comments Download
M ppapi/proxy/ppb_opengles2_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -8 lines 0 comments Download
M webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +6 lines, -12 lines 0 comments Download
M webkit/plugins/ppapi/ppb_opengles_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -8 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
apatrick_chromium
Scary review.
9 years, 5 months ago (2011-07-01 01:30:25 UTC) #1
piman
On Thu, Jun 30, 2011 at 6:30 PM, <apatrick@chromium.org> wrote: > Reviewers: jbates, piman, > ...
9 years, 5 months ago (2011-07-01 01:57:17 UTC) #2
apatrick_chromium
> I will look at the change, I think it's a good change, but before ...
9 years, 5 months ago (2011-07-01 20:46:15 UTC) #3
apatrick_chromium
I think I got the flush semantics back as they were. I.e. flush is passed ...
9 years, 5 months ago (2011-07-07 23:38:58 UTC) #4
nduca
Are there any complications with this and the world where we have GL commands being ...
9 years, 5 months ago (2011-07-08 19:52:10 UTC) #5
apatrick_chromium
On 2011/07/08 19:52:10, nduca wrote: > Are there any complications with this and the world ...
9 years, 5 months ago (2011-07-08 19:53:36 UTC) #6
apatrick_chromium
On 2011/07/08 19:53:36, apatrick_chromium wrote: > On 2011/07/08 19:52:10, nduca wrote: > > Are there ...
9 years, 5 months ago (2011-07-08 19:55:31 UTC) #7
apatrick_chromium
+kbr
9 years, 5 months ago (2011-07-08 23:47:04 UTC) #8
piman
Overall, looks good, but I have a couple of comments. Also one question: now that ...
9 years, 5 months ago (2011-07-09 20:40:22 UTC) #9
jbates
Looks like a great cleanup. This brings us back closer to how GL is supposed ...
9 years, 5 months ago (2011-07-11 18:39:50 UTC) #10
apatrick_chromium
> Also one question: now that we block the entire GpuChannel if any context is ...
9 years, 5 months ago (2011-07-11 21:24:27 UTC) #11
apatrick_chromium
All done. Also, see this related follow up patch: http://codereview.chromium.org/7313032/ http://codereview.chromium.org/7253052/diff/23007/content/common/gpu/gpu_command_buffer_stub.cc File content/common/gpu/gpu_command_buffer_stub.cc (right): http://codereview.chromium.org/7253052/diff/23007/content/common/gpu/gpu_command_buffer_stub.cc#newcode309 ...
9 years, 5 months ago (2011-07-11 21:25:45 UTC) #12
apatrick_chromium
Oh wait. Missed something. Hold on...
9 years, 5 months ago (2011-07-11 21:28:23 UTC) #13
apatrick_chromium
Okay fixed now PTAL. The issue was, in general, the command buffer that causes a ...
9 years, 5 months ago (2011-07-11 23:13:07 UTC) #14
piman
one fix then LGTM. Adding a ReportState in OnRescheduled() would mean the client can avoid ...
9 years, 5 months ago (2011-07-11 23:38:33 UTC) #15
apatrick_chromium
http://codereview.chromium.org/7253052/diff/30022/content/common/gpu/gpu_command_buffer_stub.cc File content/common/gpu/gpu_command_buffer_stub.cc (right): http://codereview.chromium.org/7253052/diff/30022/content/common/gpu/gpu_command_buffer_stub.cc#newcode313 content/common/gpu/gpu_command_buffer_stub.cc:313: command_buffer_->Flush(state.put_offset); On 2011/07/11 23:38:33, piman wrote: > Adding a ...
9 years, 5 months ago (2011-07-11 23:56:33 UTC) #16
piman
LGTM
9 years, 5 months ago (2011-07-11 23:57:31 UTC) #17
apatrick_chromium
+brettw for ppapi owners review. +vrk for progress on seeing if this regresses the accelerated ...
9 years, 5 months ago (2011-07-12 00:01:37 UTC) #18
apatrick_chromium
+jam for webkit/plugins owners review. +kbr for webkit/gpu owners review.
9 years, 5 months ago (2011-07-12 00:03:48 UTC) #19
Ken Russell (switch to Gerrit)
One minor issue with the webkit/gpu changes. http://codereview.chromium.org/7253052/diff/29077/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc File webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc (right): http://codereview.chromium.org/7253052/diff/29077/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc#newcode45 webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc:45: } This ...
9 years, 5 months ago (2011-07-12 00:22:07 UTC) #20
apatrick_chromium
http://codereview.chromium.org/7253052/diff/29077/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc File webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc (right): http://codereview.chromium.org/7253052/diff/29077/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc#newcode45 webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc:45: } On 2011/07/12 00:22:07, kbr wrote: > This doesn't ...
9 years, 5 months ago (2011-07-12 01:00:42 UTC) #21
Ken Russell (switch to Gerrit)
webkit/gpu LGTM
9 years, 5 months ago (2011-07-12 01:01:41 UTC) #22
jam
On 2011/07/12 00:03:48, apatrick_chromium wrote: > +jam for webkit/plugins owners review. brettw can review webkit/plugins/pppai ...
9 years, 5 months ago (2011-07-12 01:03:26 UTC) #23
piman
On Mon, Jul 11, 2011 at 6:03 PM, <jam@chromium.org> wrote: > On 2011/07/12 00:03:48, apatrick_chromium ...
9 years, 5 months ago (2011-07-12 01:08:42 UTC) #24
vrk (LEFT CHROMIUM)
> +vrk for progress on seeing if this regresses the accelerated ppapi video stuff. > ...
9 years, 5 months ago (2011-07-13 22:15:38 UTC) #25
jbates
LGTM
9 years, 5 months ago (2011-07-14 21:27:52 UTC) #26
apatrick_chromium
On 2011/07/13 22:15:38, Victoria Kirst wrote: > > +vrk for progress on seeing if this ...
9 years, 5 months ago (2011-07-18 21:52:18 UTC) #27
vrk (LEFT CHROMIUM)
9 years, 5 months ago (2011-07-18 22:47:16 UTC) #28
On 2011/07/18 21:52:18, apatrick_chromium wrote:
> Rebased to tot and uploaded. Thanks.

LGTM

Everything still works great! Thanks!

Powered by Google App Engine
This is Rietveld 408576698