[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
Tue Feb 24 15:31:04 PST 2015


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

Dean Jackson <dino at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #247262|review?                     |review+
              Flags|                            |

--- Comment #17 from Dean Jackson <dino at apple.com> ---
Comment on attachment 247262
  --> https://bugs.webkit.org/attachment.cgi?id=247262
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=247262&action=review

> Source/WebCore/platform/graphics/GraphicsContext3D.h:1278
> +    // Call to make during draw calls to check on the GPU's status

Nit: missing .

Naming comments coming.

> Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm:68
> +const int checkGPUStatusDrawIterations = 5;

Maybe GPUStatusCheckThreshold?

> Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm:69
> +int GraphicsContext3D::drawCounter = 0;

And checkCounter? I don't do names well, so whatever you think is best.

> Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm:370
> +void GraphicsContext3D::checkGPUStatus()

Suggest naming this checkGPUStatusIfNecessary or something.

> Source/WebCore/platform/graphics/mac/WebGLLayer.mm:193
> +    GLint restartStatus = 0;
> +    EAGLContext* currentContext = _context->platformGraphicsContext3D();
> +    [currentContext getParameter:kEAGLCPGPURestartStatus to:&restartStatus];
> +    if (restartStatus == kEAGLCPGPURestartStatusCaused || restartStatus == kEAGLCPGPURestartStatusBlacklisted) {
> +        [EAGLContext setCurrentContext:0];
> +        [static_cast<EAGLContext*>(currentContext) release];
> +        _context->forceContextLost();
> +    }
>  #else
>      [super display];
> +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
> +    GLint restartStatus = 0;
> +    CGLGetParameter(_context->platformGraphicsContext3D(), kCGLCPGPURestartStatus, &restartStatus);
> +    if (restartStatus == kCGLCPGPURestartStatusCaused || restartStatus == kCGLCPGPURestartStatusBlacklisted) {
> +        CGLSetCurrentContext(0);
> +        CGLDestroyContext(_context->platformGraphicsContext3D());
> +        _context->forceContextLost();
> +    }
> +#endif

Do you think we need to test here? These calls should be fine. It's the actual draw calls that you tested above that would cause a restart. Unless you disagree, I say remove these ones.

> Source/WebCore/platform/spi/ios/OpenGLESSPI.h:2
> + * Copyright (C) 2014 Apple Inc. All rights reserved.

2015

-- 
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/20150224/6f07e7d6/attachment-0002.html>


More information about the webkit-unassigned mailing list