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

Issue 735623003: WebGL: accelerated texImage2D and texSubImage2D for canvas (Closed)

Created:
6 years ago by dshwang
Modified:
6 years ago
CC:
blink-reviews, blink-reviews-css, blink-reviews-html_chromium.org, ed+blinkwatch_opera.com, dglazkov+blink, Rik, apavlov+blink_chromium.org, groby+blinkspell_chromium.org, darktears, aandrey+blink_chromium.org, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

WebGL: accelerated texImage2D and texSubImage2D for canvas Currently, we accelerates subset of texImage2D due to glCopyTextureCHROMIUM limitation. Otherwise, we readback canvas content from GPU and then upload the pixel to GPU. glCopyTextureCHROMIUM requires destFormat is GL_RGB/GL_RGBA and level is 0 and destType is GL_UNSIGNED_BYTE. If we use a temporary texture, whose format is GL_RGBA, level is 0 and type is GL_UNSIGNED_BYTE, we can copy others from canvas texture to temporary texture to dest texture. Creating temporary texture is pretty lighter than readback and upload. In addition, this CL fixes a potential bug that HTMLCanvasElement::copiedImage(FrontBuffer) returns BackBuffer. It's because HTMLCanvasElement::copiedImage() always returns FrontBuffer after this CL. Perf measurement on Intel Haswell i7. texSubImage2D(Canvas) speeds up by 12 times 93.82 run/s -> 1207.67 run/s TEST=Covered by WebglConformance.conformance_extensions_oes_texture_float_with_canvas WebglConformance.conformance_extensions_oes_texture_half_float_with_canvas WebglConformance.conformance_textures_tex_image_and_sub_image_2d_with_canvas_rgb565 WebglConformance.conformance_textures_tex_image_and_sub_image_2d_with_canvas_rgba4444 WebglConformance.conformance_textures_tex_image_and_sub_image_2d_with_canvas_rgba5551 WebglConformance.conformance_textures_tex_image_and_sub_image_2d_with_webgl_canvas_rgb565 WebglConformance.conformance_textures_tex_image_and_sub_image_2d_with_webgl_canvas_rgba4444 WebglConformance.conformance_textures_tex_image_and_sub_image_2d_with_webgl_canvas_rgba5551 virtual/gpu/fast/canvas/webgl/texture-npot.html virtual/gpu/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgb565.html virtual/gpu/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba4444.html virtual/gpu/fast/canvas/webgl/tex-image-and-sub-image-2d-with-canvas-rgba5551.html BUG=349871, 420357 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=187151

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rebase to ToT, and dropping copiedImage fix #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -36 lines) Patch
M Source/core/html/canvas/WebGLRenderingContextBase.h View 1 4 chunks +12 lines, -9 lines 0 comments Download
M Source/core/html/canvas/WebGLRenderingContextBase.cpp View 1 7 chunks +87 lines, -27 lines 4 comments Download

Messages

Total messages: 14 (2 generated)
dshwang
6 years ago (2014-11-27 21:29:55 UTC) #2
dshwang
@kbr, could you review? This CL makes WebGL never readback and upload from other WebGL ...
6 years ago (2014-11-27 21:31:10 UTC) #3
Ken Russell (switch to Gerrit)
I'm sorry for taking so long to start reviewing this. It's a fairly large change ...
6 years ago (2014-12-06 02:27:04 UTC) #4
dshwang
On 2014/12/06 02:27:04, Ken Russell wrote: > I'm sorry for taking so long to start ...
6 years ago (2014-12-08 14:08:14 UTC) #5
dshwang
https://codereview.chromium.org/735623003/diff/1/Source/core/html/HTMLCanvasElement.cpp File Source/core/html/HTMLCanvasElement.cpp (right): https://codereview.chromium.org/735623003/diff/1/Source/core/html/HTMLCanvasElement.cpp#newcode682 Source/core/html/HTMLCanvasElement.cpp:682: Image* HTMLCanvasElement::copiedImage() const On 2014/11/27 21:31:10, dshwang wrote: > ...
6 years ago (2014-12-08 14:09:24 UTC) #6
dshwang
I measure performance on Haswell i7 using Canvas/upload-webgl-to-texture.html with some change as follow: texSubImage2D speed ...
6 years ago (2014-12-09 14:40:38 UTC) #7
Ken Russell (switch to Gerrit)
Thanks for this contribution. The code changes look good, but I'd like to ask you ...
6 years ago (2014-12-11 01:11:14 UTC) #8
dshwang
On 2014/12/11 01:11:14, Ken Russell wrote: > Thanks for this contribution. Thank you for good ...
6 years ago (2014-12-12 17:30:02 UTC) #9
Ken Russell (switch to Gerrit)
On 2014/12/12 17:30:02, dshwang wrote: > Thank you. I'll submit patch to WebGL conformance suite ...
6 years ago (2014-12-13 00:22:16 UTC) #10
dshwang
On 2014/12/13 00:22:16, Ken Russell wrote: > On 2014/12/12 17:30:02, dshwang wrote: > > Thank ...
6 years ago (2014-12-15 16:23:41 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/735623003/20001
6 years ago (2014-12-15 16:25:17 UTC) #13
commit-bot: I haz the power
6 years ago (2014-12-15 16:31:56 UTC) #14
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=187151

Powered by Google App Engine
This is Rietveld 408576698