Make WebGL context limit configurable
Reported by
brian...@gmail.com,
Oct 4 2017
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Steps to reproduce the problem: 1. Create more than 16 WebGL contexts in a render process. What is the expected behavior? The WebGL context limit should be configurable and/or dynamically determined based on GPU memory, so that users on systems with powerful GPUs and lots of GPU memory can render more than 16 WebGL contexts without losing contexts. Ideally, the limit would be determined dynamically based on available GPU memory, but at minimum please expose this via chrome://flags/. What went wrong? Context loss beyond 16 contexts. Did this work before? No Does this work in other browsers? N/A Chrome version: 61.0.3163.100 Channel: stable OS Version: 10.0 Flash Version: We have complex data visualization apps rendering multiple WebGL-based charts at once, and this context loss is a major roadblock. I can't think of any reason that users with 8 or 11 GB of GPU memory should have an arbitrary cap of 16 WebGL contexts.
,
Oct 4 2017
,
Oct 4 2017
,
Oct 5 2017
I can see how having Chrome try to determine the context limit could be difficult. But in that case, I'd say just expose it as a flag so that folks can change it themselves to a known good value. In our case, reducing the number of contexts isn't a viable option. We're using a WebGL charting library (Plotly), and each of the contexts wraps a separate chart. So each one is totally unrelated to the others, and each has separate chart axes, controls, event handlers, and data. So "merging" all of them into one context, or synchronizing offscreen vs. onscreen contexts, essentially translates to: write your own charting engine from scratch. That's man-years of work. I totally understand that Chrome *has* to impose some default limit on the WebGL context count. But I don't see why exposing that limit as a flag for user modification would be a problem. This is an internal app, so we know what hardware is being used. Exposing the limit as a flag (with applicable warning text) would let folks tune this limit to a more appropriate value.
,
Oct 5 2017
OK, if adding an about:flags entry would work for your case we can easily make that change.
,
Oct 26 2017
Issue 778277 has been merged into this issue.
,
Jan 5 2018
Did anything ever happen with this? KBR seemed to think this would be easy to do, but it doesn't look like the change was ever made. Thanks, Brian
,
Jan 9 2018
Sorry for forgetting about this. Wiring it up now.
,
May 3 2018
KBR, did this ever make it into a release? Thanks.
,
May 4 2018
Sorry, I dropped this on the floor. Will try to push it over the finish line soon.
,
Jun 27 2018
Don't mean to pester, @kbr, but any update on this? Thanks.
,
Jun 30 2018
Sorry for dropping this again. https://chromium-review.googlesource.com/1073888 up for review implementing this.
,
Jul 13
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bfea76f48f8af2bd76157cfc0a025b3c81241777 commit bfea76f48f8af2bd76157cfc0a025b3c81241777 Author: Kenneth Russell <kbr@chromium.org> Date: Fri Jul 13 20:15:45 2018 Make the maximum number of WebGL contexts configurable. Bug: 771792 Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_layout_tests_slimming_paint_v2;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel Change-Id: I34ffae8b8ff4d1372eedcdc0b6549bd68a521b84 Reviewed-on: https://chromium-review.googlesource.com/1073888 Reviewed-by: Antoine Labour <piman@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org> Cr-Commit-Position: refs/heads/master@{#575044} [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/content/public/browser/gpu_utils.cc [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/gpu/config/gpu_feature_info.h [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/gpu/config/gpu_preferences.h [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/gpu/config/gpu_switches.cc [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/gpu/config/gpu_switches.h [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/gpu/config/gpu_util.cc [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/gpu/ipc/common/gpu_feature_info.mojom [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/gpu/ipc/common/gpu_feature_info_struct_traits.h [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/gpu/ipc/common/gpu_preferences.mojom [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/gpu/ipc/common/gpu_preferences_struct_traits.h [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc [modify] https://crrev.com/bfea76f48f8af2bd76157cfc0a025b3c81241777/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h
,
Jul 16
This change is currently shipping in Chrome Canary, and using the attached manual test case and the command line flag --max-active-webgl-contexts I verified it's working. (The basic functionality was already covered under an existing automated context_lost test.)
,
Dec 3
@kbr, did this ever make it into vanilla Chrome? I don't see a flag or it on chrome://flags, and it's not clear whether the command line flag is actually doing something. Thanks.
,
Dec 3
Yes, it's shipping in Chrome Stable as of Chrome 69 (see omahaproxy.appspot.com and plug in the commit hash from above. Launching Chrome Stable (70.0.3538.110 (Official Build) (64-bit)) with this command line argument: --max-active-webgl-contexts=32 increases the context limit per the test in #14. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by kbr@chromium.org
, Oct 4 2017