New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 616554 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocked on:
issue 654039

Blocking:
issue 657528
issue 770381
issue 785415
issue 828135



Sign in to add a comment

Prototype asynchronous getBufferSubData in WebGL 2.0

Project Member Reported by kbr@chromium.org, Jun 1 2016

Issue description

It's a longstanding problem that reading data back from the GPU, especially in WebGL and especially in Chrome, is slow due to Chrome's deep graphics pipeline, which is both multithreaded and multi-process.

Applications that have attempted to use primitives like readPixels have been stymied because issuing even a single 1x1 readPixel call per frame can completely destroy the performance characteristics of the application.

ES 3.0 and WebGL 2.0 introduce enough primitives to allow asynchronous, server-side readback of data, for example using pixel buffer objects. However, getting data out of these buffer objects is still a synchronous operation, via getBufferSubData ( https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.3 ).

We'd like to prototype a getBufferSubDataAsync which returns a Promise, where the success callback receives a newly-allocated ArrayBuffer. This should eliminate all synchronous calls in fetching data back from the GPU.

 
For command buffer side, we could add something like MapBufferRangeAsync() and use signal query to check for completion.

BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, query_id)
MapBufferRangeAsync(...)
EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM)
ContextSupport::SignalQuery(query_id, promise_callback, ...)

Comment 2 by kbr@chromium.org, Aug 9 2016

Owner: kbr@chromium.org
Status: Assigned (was: Untriaged)
Taking this.

Comment 3 by kbr@chromium.org, Sep 21 2016

Owner: kainino@chromium.org
Still buried with other work. Kai will take this.

Comment 4 by kbr@chromium.org, Sep 21 2016

The pull request with the proposed API is https://github.com/KhronosGroup/WebGL/pull/1937 .

Cc: yunchao...@intel.com yang...@intel.com qiankun....@intel.com
Project Member

Comment 6 by bugdroid1@chromium.org, Oct 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8a02646e95830e7c67dc884280c94b219ae13e7b

commit 8a02646e95830e7c67dc884280c94b219ae13e7b
Author: kainino <kainino@chromium.org>
Date: Fri Oct 07 20:08:02 2016

fix an OBOE in getBufferSubData range checking

BUG= 616554 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2391073004
Cr-Commit-Position: refs/heads/master@{#423948}

[modify] https://crrev.com/8a02646e95830e7c67dc884280c94b219ae13e7b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Blockedon: 654039
Blocking: 654609
Blockedon: 657528
Blocking: -654609
Project Member

Comment 11 by bugdroid1@chromium.org, Oct 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/884e8e8ad9cf667829d80f4bd222a0369baa088b

commit 884e8e8ad9cf667829d80f4bd222a0369baa088b
Author: kainino <kainino@chromium.org>
Date: Wed Oct 19 23:34:13 2016

Implement a prototype for the proposed getBufferSubDataAsync entry point specified in this WebGL PR:

https://github.com/KhronosGroup/WebGL/pull/2079

BUG= 616554 
BUG= 654609 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
NOTRY=true

Review-Url: https://chromiumcodereview.appspot.com/2379203002
Cr-Commit-Position: refs/heads/master@{#426335}

[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/content/renderer/webgraphicscontext3d_provider_impl.cc
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/content/renderer/webgraphicscontext3d_provider_impl.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/GLES2/gl2chromium_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/build_gles2_cmd_buffer.py
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_c_lib_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_implementation.cc
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_implementation.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_implementation_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_implementation_unittest.cc
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_interface.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_interface_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/cmd_buffer_functions.txt
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/service/gles2_cmd_decoder.cc
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/third_party/WebKit/Source/modules/webgl/DEPS
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferSoftwareRenderingTest.cpp
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/third_party/WebKit/Source/platform/graphics/test/FakeWebGraphicsContext3DProvider.h
[modify] https://crrev.com/884e8e8ad9cf667829d80f4bd222a0369baa088b/third_party/WebKit/public/platform/WebGraphicsContext3DProvider.h

Project Member

Comment 12 by bugdroid1@chromium.org, Nov 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d48a591afbf8243b00496ce097c10e98e500e585

commit d48a591afbf8243b00496ce097c10e98e500e585
Author: kainino <kainino@chromium.org>
Date: Sat Nov 12 05:19:06 2016

comment out getBufferSubDataAsync so conformance2/context/methods-2.html can pass

BUG= 616554 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2495613003
Cr-Commit-Position: refs/heads/master@{#431775}

[modify] https://crrev.com/d48a591afbf8243b00496ce097c10e98e500e585/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
[modify] https://crrev.com/d48a591afbf8243b00496ce097c10e98e500e585/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/d48a591afbf8243b00496ce097c10e98e500e585/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl

Project Member

Comment 13 by bugdroid1@chromium.org, Dec 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d21a20ac92bb56bea69eaea1b633c51e74f672f3

commit d21a20ac92bb56bea69eaea1b633c51e74f672f3
Author: kainino <kainino@chromium.org>
Date: Wed Dec 14 03:24:01 2016

Move getBufferSubDataAsync to an extension

This extension is exposed as "draft" but there isn't actually a draft of the extension spec just yet. The text in the pull request needs to be moved around.

BUG= 616554 
TBR=haraken@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2569863005
Cr-Commit-Position: refs/heads/master@{#438412}

[modify] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/modules_idl_files.gni
[modify] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/BUILD.gn
[modify] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp
[modify] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.h
[modify] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
[modify] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
[modify] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl
[modify] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/WebGLExtensionName.h
[add] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.cpp
[add] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.h
[add] https://crrev.com/d21a20ac92bb56bea69eaea1b633c51e74f672f3/third_party/WebKit/Source/modules/webgl/WebGLGetBufferSubDataAsync.idl

Comment 14 by kbr@chromium.org, Jan 12 2017

Blockedon: -657528
Blocking: 657528
Status: Fixed (was: Assigned)
I think we should call this bug fixed, and file follow-on bugs regarding it as the extension evolves. Thanks Kai for moving this forward.

Comment 15 by kbr@chromium.org, Sep 29 2017

Blocking: 770381
Blocking: 785415
Blocking: 828135

Sign in to add a comment