Bug 220380

Summary: [WinCairo] WebGL isn't shown in non-AC mode
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: WebGLAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, ews-watchlist, graouts, jdarpinian, kbr, kkinnunen, kondapallykalyan, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 220428    
Attachments:
Description Flags
WIP patch
none
Patch none

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>