emscripten-core / emscripten-core/emscripten

Change WebGL powerPreference default to high-performance?

Open
#10,000 10 comments 0 reactions 0 assignees View on GitHub
GL wontfix
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Browsers are moving to change the default WebGL powerPreference from `high-performance` to `low-power` (e.g. coming soon in [Chrome 80](https://bugs.chromium.org/p/chromium/issues/detail?id=681341#c70)). In practice this change of default means that some users (with 2 GPUs) might see the lower-end one used, and for something like a game engine that could be noticeably slower.

When creating the WebGL context, perhaps Emscripten should default to `high-performance`? I'd guess most of our users are running higher-end content. However, I'm not totally happy about such a change either, as browsers are preferring the opposite in general.

Other options:

* Just document this more.
* Add a commandline option to make it easier to force `high-performance`, instead of writing the extra code to call the C API for context creation and set `EmscriptenWebGLContextAttributes.powerPreference = EM_WEBGL_POWER_PREFERENCE_HIGH_PERFORMANCE`.
* Emit a warning in ASSERTIONS mode if `high-performance` is not set, but by default that's likely excessive.

Thoughts?

cc @juj @kenrussell @kainino0x

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.