Bug 220380 - [WinCairo] WebGL isn't shown in non-AC mode
Summary: [WinCairo] WebGL isn't shown in non-AC mode
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks: 220428
  Show dependency treegraph
 
Reported: 2021-01-06 12:29 PST by Fujii Hironori
Modified: 2021-01-07 13:36 PST (History)
8 users (show)

See Also:


Attachments
WIP patch (600 bytes, patch)
2021-01-06 12:29 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (1.58 KB, patch)
2021-01-06 12:50 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2021-01-06 12:29:07 PST
[WinCairo] WebGL isn't shown in non-AC mode

1. Start WinCairo MiniBrowser
2. Go to a WebGL page, for example, https://get.webgl.org/
   A cube is shown
3. Disable Accelerated Compositing.
   Menu → Debug → Use Accelerated Compositing
4. The cube disappears
Comment 1 Fujii Hironori 2021-01-06 12:29:24 PST
Created attachment 417114 [details]
WIP patch
Comment 2 Fujii Hironori 2021-01-06 12:50:25 PST
Created attachment 417116 [details]
Patch
Comment 3 James Darpinian 2021-01-06 13:04:14 PST
In this case, context creation should fail when the failIfMajorPerformanceCaveat context creation flag is set. Can you verify that is working?
Comment 4 Kenneth Russell 2021-01-06 14:45:03 PST
Comment on attachment 417116 [details]
Patch

r+ assuming jdarpinian's question is answered in the affirmative.
Comment 5 Fujii Hironori 2021-01-06 18:51:37 PST
(In reply to James Darpinian from comment #3)
> In this case, context creation should fail when the
> failIfMajorPerformanceCaveat context creation flag is set. Can you verify
> that is working?

No, it doesn't fail.
I don't think it should fail in the case.
Disabling accelerated compositing doesn't necessarily mean no GPU available.
I disables WinCairo's accelerated compositing for some purposes:

1. non-AC mode is still faster than AC mode in WinCairo. (WinCairo's compositor should be improved)
2. Comparing AC mode and non-AC mode rendering results for debugging compositor's issues

WebGL works nicely in non-AC mode with this patch. I think there is no MajorPerformanceCaveat.
Comment 6 James Darpinian 2021-01-06 21:15:55 PST
This exact situation, using glReadPixels in the compositing path, is exactly why failIfMajorPerformanceCaveat was originally added to the spec. It is a big performance problem for fullscreen WebGL apps on high resolution monitors.
Comment 7 Fujii Hironori 2021-01-06 22:29:38 PST
(In reply to James Darpinian from comment #6)
> This exact situation, using glReadPixels in the compositing path, is exactly
> why failIfMajorPerformanceCaveat was originally added to the spec. It is a
> big performance problem for fullscreen WebGL apps on high resolution
> monitors.

Yeah, it's pretty likely happening. Reading back from GPU to CPU is so expensive.

OK. I'm going to land the patch without solving the
failIfMajorPerformanceCaveat problem and leave the task into my
lengthy to-do list.
Comment 8 Kenneth Russell 2021-01-07 11:18:53 PST
(In reply to Fujii Hironori from comment #7)
> (In reply to James Darpinian from comment #6)
> > This exact situation, using glReadPixels in the compositing path, is exactly
> > why failIfMajorPerformanceCaveat was originally added to the spec. It is a
> > big performance problem for fullscreen WebGL apps on high resolution
> > monitors.
> 
> Yeah, it's pretty likely happening. Reading back from GPU to CPU is so
> expensive.
> 
> OK. I'm going to land the patch without solving the
> failIfMajorPerformanceCaveat problem and leave the task into my
> lengthy to-do list.

Would you mind filing a bug here under the WebGL component and blocking it on this one? That way at least it's tracked in a way that others might potentially contribute to the solution. Thanks!
Comment 9 Fujii Hironori 2021-01-07 12:22:04 PST
Sure.
Filed: Bug 220428 – [WinCairo] WebGL context creation should fail if accelerated compositing is disabled and the failIfMajorPerformanceCaveat context creation flag is set
Comment 10 Fujii Hironori 2021-01-07 12:26:41 PST
Comment on attachment 417116 [details]
Patch

Clearing flags on attachment: 417116

Committed r271254: <https://trac.webkit.org/changeset/271254>
Comment 11 Fujii Hironori 2021-01-07 12:26:45 PST
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2021-01-07 12:27:16 PST
<rdar://problem/72900500>