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

Issue 781586 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Feature



Sign in to add a comment

Clearing IOSurfaces after creation quadruples the cost to bind image to texture.

Project Member Reported by vmi...@chromium.org, Nov 5 2017

Issue description

Chrome Version: 64.0.3256.0
OS: OSX 10.12.6

We have disabled IOSurface clearing on OSX 10.9 and 10.10 for performance reasons.  I am noticing that it takes 4 times longer than without clearing on 10.12.6 as well.

For surfaces that are used for GL Rendering (Ganesh, WebGL, 2D Canvas) we should avoid clearing the surface, since we have tracking in the GLES2Decoder to ensure the texture is fully initialized before use.

The binding cost is accumulated until we call glFlush inside "ImageTransportSurfaceOverlayMac::ApplyBackpressure".

For comparison, see durations of "ImageTransportSurfaceOverlayMac::ApplyBackpressure" on the GPU Main thread in traces with clear (*_orig.json.gz) and without clear (*_noclear.json.gz).
 
trace_wikipedia_zoom_orig.json.gz
446 KB Download
trace_wikipedia_zoom_noclear.json.gz
363 KB Download
Components: Internals>Compositing>Rasterization Internals>GPU>Internals
This should be possible to do now when IOSurfaces are created on the GPU service side, via sunnyps's TexStorage2DImageCHROMIUM extension.
Labels: -Type-Bug Type-Feature
Labels: -Pri-2 Pri-1
Owner: sunn...@chromium.org
Status: Assigned (was: Available)
I uploaded a CL for this: https://chromium-review.googlesource.com/c/chromium/src/+/804597

I could reproduce the 4x improvement in swap buffers time as in #0, although the durations are different.
trace_wikipedia_zoom_clear.json.gz
1.4 MB Download
trace_wikipedia_zoom_noclear.json.gz
1.0 MB Download
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 7 2017

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

commit ea6e12b3635b8f77966cd4bacc02c31b914e95c4
Author: Sunny Sachanandani <sunnyps@chromium.org>
Date: Thu Dec 07 03:04:36 2017

gpu: Don't clear anonymous IO surfaces.

Anonymous IO surfaces that are only used on the gpu service as render
targets don't need to be cleared on initialization. vmiura@ found that
this quadruples the cost of binding the io surface and that this cost is
deferred to the flush.

R=piman
BUG= 781586 

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;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
Change-Id: If7d0425a57fec4772f05daaf04dee9aaee0c730f
Reviewed-on: https://chromium-review.googlesource.com/804597
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522322}
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/command_buffer/service/gles2_cmd_decoder.cc
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/command_buffer/service/image_factory.cc
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/command_buffer/service/image_factory.h
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/command_buffer/tests/texture_image_factory.cc
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/command_buffer/tests/texture_image_factory.h
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/ipc/service/gpu_memory_buffer_factory_android_hardware_buffer.cc
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/ipc/service/gpu_memory_buffer_factory_android_hardware_buffer.h
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.cc
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.h
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/ipc/service/gpu_memory_buffer_factory_io_surface.cc
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/ui/gfx/generic_shared_memory_id.h
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/ui/gfx/mac/io_surface.cc
[modify] https://crrev.com/ea6e12b3635b8f77966cd4bacc02c31b914e95c4/ui/gfx/mac/io_surface.h

Was this resolved with the fix landed in #5?

Comment 7 by vmi...@chromium.org, Feb 27 2018

Status: Fixed (was: Assigned)
This was fixed by the change in #5.

Sign in to add a comment