Bug 172520 - checkGPUStatus needs to exercise instancing calls
Summary: checkGPUStatus needs to exercise instancing calls
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-23 12:42 PDT by Dean Jackson
Modified: 2017-05-23 13:50 PDT (History)
9 users (show)

See Also:


Attachments
Patch (20.81 KB, patch)
2017-05-23 12:49 PDT, Dean Jackson
bfulgham: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2017-05-23 12:42:42 PDT
checkGPUStatus needs to exercise instancing calls
Comment 1 Dean Jackson 2017-05-23 12:49:54 PDT
Created attachment 311040 [details]
Patch
Comment 2 Simon Fraser (smfr) 2017-05-23 12:56:44 PDT
Comment on attachment 311040 [details]
Patch

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

> Source/WebCore/html/canvas/WebGLRenderingContextBase.h:361
> +    WEBCORE_EXPORT void setFailNextGPUStatusCheck();

Maybe add "ForTesting" to the name here and elsewhere, to make it a bit less mysterious.
Comment 3 Brent Fulgham 2017-05-23 13:24:11 PDT
Comment on attachment 311040 [details]
Patch

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

Looks good! I mostly commented just to test my local WebKit build. :-) r=me.

> Source/WebCore/platform/graphics/GraphicsContext3D.h:1441
> +    unsigned m_statusCheckCount { 0 };

It seems like this could overflow if you status check counted enough times. But maybe you reset later?

> Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm:65
> +static const unsigned statusCheckThreshold = 5;

I never know when we should be using constexpr. Here? No?

> Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm:652
> +    m_statusCheckCount = (m_statusCheckCount + 1) % statusCheckThreshold;

So this resets every statusCheckThreshold counts. Since that's currently set to 5, unsigned might be bigger than we need, but seems fine.
Comment 4 Dean Jackson 2017-05-23 13:50:32 PDT
Committed r217298: <http://trac.webkit.org/changeset/217298>