[Webkit-unassigned] [Bug 141567] WebGL: Destroy the GLContext is a GPU restart has been detected.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 19 17:58:16 PST 2015


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

--- Comment #6 from Roger Fong <roger_fong at apple.com> ---
(In reply to comment #5)
> Comment on attachment 246923 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=246923&action=review
> 
> > Source/WebCore/platform/graphics/GraphicsContext3D.h:1445
> > +    
> > +    WebGLRenderingContextBase* m_webglContext;
> 
> Do we ever think there might be a time when the WebGL context goes away
> before the GC3D?

Hmm, if the destructor for WebGLRenderingContextBase gets called we always also destroy the associated graphicsContext3D, so this shouldn't be an issue.
I believe I added a nullcheck to the forceContextLost call just in case. Maybe an assert would be more appropriate though.

> 
> > Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm:202
> > +    GLint abortOnBlacklist = 0;
> > +    CGLSetParameter(m_contextObj, kCGLCPAbortOnGPURestartStatusBlacklisted, &abortOnBlacklist);
> 
> You'll need to #if around these since they are only available on OS X 10.10+
> 
> > Source/WebCore/platform/graphics/mac/WebGLLayer.mm:180
> > +    GLint restartStatus = 0;
> > +    CGLGetParameter(_context->platformGraphicsContext3D(), kCGLCPGPURestartStatus, &restartStatus);
> > +    if (restartStatus == kCGLCPGPURestartStatusCaused || restartStatus == kCGLCPGPURestartStatusBlacklisted) {
> > +        CGLDestroyContext(_context->platformGraphicsContext3D());
> > +        _context->forceContextLost();
> > +    }
> 
> Similarly here.
> 
> One concern I have is that we're only doing this test on display. Which
> means you could hose the system if you executed a lot of draw calls before
> allowing the system to draw. We might want to have this code in the drawing
> entry points, drawElements and drawArrays, but only test every X iterations
> or something.
How does 5 iterations sound?

> 
> Anyway, if this makes an improvement on our hanging examples, let's stick
> with it.

Hmm if I do stick this stuff in drawArrays I feel like I won't need to have it in the display method, since the draw methods will always come first. Does that sound right?

Although, I suppose, it could help though if there is only 1 draw call, we'll probably want to catch the error before having to attempt to draw more frames. (Thus in the display step), so maybe ew want both.

-- 
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/20150220/258530da/attachment-0002.html>


More information about the webkit-unassigned mailing list