DescriptionWebGL: 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
Messages
Total messages: 14 (2 generated)
|