[Webkit-unassigned] [Bug 202834] New: Implementation of powerPreference on WebGL's ANGLE backend is insufficient

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 10 17:39:52 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=202834

            Bug ID: 202834
           Summary: Implementation of powerPreference on WebGL's ANGLE
                    backend is insufficient
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebGL
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: kbr at google.com
                CC: dino at apple.com, jdarpinian at gmail.com,
                    justin_fan at apple.com
            Blocks: 198948

The EGL_ANGLE_power_preference extension advertised by ANGLE, and used by the ANGLE backend for WebGL to implement the powerPreference attribute, has some deficiencies preventing it from working as desired.
https://chromium.googlesource.com/angle/angle/+/refs/heads/master/extensions/EGL_ANGLE_power_preference.txt

Basically:

1) ANGLE never calls CGLSetVirtualScreen against its internal CGLContextObj when either activating or deactivating the discrete GPU. This means that the "high-performance" power preference is effectively a no-op, even though the discrete GPU is actually being activated via the allocation of a CGLPixelFormatObj that doesn't support offline renderers.

2) If this started being called, multisampled renderbuffers would stop working which were allocated on the "other" GPU. This behavior was discovered in Chromium and has just been worked around in https://bugs.chromium.org/p/chromium/issues/detail?id=681341#c58 . The symptom is that content with antialias:true (the default) stops rendering.

In order to fix these issues, it appears the following changes are needed:

A) ANGLE's implementation of EGL_ANGLE_power_preference needs to be improved to actually call CGLSetVirtualScreen appropriately.
B) Some sort of callback notification about GPU switching needs to be dispatched out of ANGLE back to WebKit.
C) WebKit needs to respond to these notifications:
C1) For WebGL 1.0 contexts with preserveDrawingBuffer:false, or WebGL 2.0 contexts with preserveDrawingBuffer:false *and* no user-allocated multisampled renderbuffers, silently reallocate the multisampled renderbuffers associated with the antialiasing implementation.
C2) For any contexts with preserveDrawingBuffer:true, *or* WebGL 2.0 contexts in which the user has allocated a multisampled renderbuffer, force a context lost and context restored event pair.

Any feedback on whether this appears to be the correct approach is greatly appreciated.


Referenced Bugs:

https://bugs.webkit.org/show_bug.cgi?id=198948
[Bug 198948] Meta: use ANGLE as the backend for WebKit's WebGL implementation
-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191011/ede1acfd/attachment.html>


More information about the webkit-unassigned mailing list