[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Public WebGL] Context creation flag proposal: "failIfMajorPerformanceCaveat"
I'd like to propose a new context creation flag to help WebGL apps make better decisions about performance tradeoffs: "failIfMajorPerformanceCaveat".
The problem we're facing is that WebGL sometimes offers drastically reduced performance compared to what you would expect given the hardware it's running on. For example, if a machine has a GPU that is blacklisted for WebGL, the browser might use a software renderer that is much slower. Or, if the browser is using a software compositor, it might have to readback the WebGL framebuffer into system memory before drawing it to the screen.
For apps that aren't full-screen or otherwise don't stress performance too much, these reduced-performance modes can work fine, so we don't want to simply disable WebGL in these cases. However, many apps don't work well in these reduced-performance modes. Apps that have a fallback rendering path (e.g. a 2D canvas mode) might prefer to use it instead of a reduced-performance WebGL context, but right now there's no way for apps to tell when WebGL is in a reduced-performance mode (vs. the user's machine just generally being slow).
"failIfMajorPerformanceCaveat" would default to false. When "failIfMajorPerformanceCaveat" is true, context creation would fail if WebGL is known to be drastically slower than a native app making equivalent OpenGL calls.
This means, for example, that context creation would fail if the browser has to readback the WebGL framebuffer into system memory before drawing it to the screen. Context creation would also fail if the browser is using a software renderer due to the user's GPU being blacklisted for WebGL. In these cases apps could switch to a fallback rendering path, or try again with "failIfMajorPerformanceCaveat:false" and the knowledge that they should use a low-resolution mode.
Thoughts? Alternate naming suggestions?