emscripten-core/emscripten

Support `desynchronized` canvas context attribute

Geschlossen

#8.406 geöffnet am 05.04.2019

 (5 Kommentare) (5 Reaktionen) (0 zugewiesene Personen)C++ (3.519 Forks)batch import
good first bughelp wanted

Repository-Metriken

Stars
 (27.361 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 19T 10h) (147 gemergte PRs in 30 T)

Beschreibung

Chrome has recently added a desynchronized canvas context attribute that disables double buffering for canvases to achieve lower latency. It will be available by default on Chrome 75 (currently on Canary), it's possible to make it available in Chrome 73 by enabling chrome://flags/#enable-experimental-web-platform-features.

We should add desynchronized to EmscriptenWebGLContextAttributes, and if true, set both desynchronized and lowLatency properties to true in the getContext call that creates the context. lowLatency is the old name for this feature, used up until Chrome 74.

If needed for debugging and writing unit tests, ctx.getContextAttributes() can be called on the created context to check if the flag is supported and was accepted.

See https://www.chromestatus.com/feature/6360971442388992 and https://docs.google.com/document/d/1-Z_dj9AQ4SjgDLAEY3ELR0YrlHR3JZyJPhaHAstS5WU/edit# (this link focuses mostly on ChromeOS).

Contributor Guide