cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.84k stars 2.92k forks source link

WebGL doesn't work with SelfHost BrowserSubProcess in CefSharp 121 #4706

Closed n303ef closed 8 months ago

n303ef commented 8 months ago

Is there an existing issue for this?

CefSharp Version

121.3.4

Operating System

Windows 11

Architecture

x64

.Net Version

.Net 4.7.2

Implementation

WinForms

Reproduction Steps

Enable SelfHost BrowserSubProcess (or enable Chrome Runtime which automatically enables Self Host) and open: https://get.webgl.org/

Expected behavior

Should confirm WebGL support and show 3D shape image.

Actual behavior

You can see text "Hmm. While your browser seems to support WebGL, it is disabled or unavailable."

Regression?

This worked in CefSharp 120 and lower versions

Known Workarounds

Browser surely is created with WebGl =CefState.Enabled Problem doesn't reproduce in "cefclient.exe --multi-threaded-message-loop --no-sandbox --enable-chrome-runtime"

Does this problem also occur in the CEF Sample Application

No

Other information

It works if we change renderer to GLES:

settings.CefCommandLineArgs.Add("use-angle", "gles");

omerbalash commented 8 months ago

This is not a CefSharp exclusive issue. I am seeing it in C++ as well. My GPU process has the exact same arguments as the cefclient one, and i see the EGL libraries are loaded into the process. I tried setting everything to default similar to the cefclient sample and setting webgl to enabled explicitly during browser creation. But the issue is reproduced.

If i choose Swiftshader as webgl it does work however. If you find a solution could you please update the thread?

n303ef commented 8 months ago

This is not a CefSharp exclusive issue

But why is it working well without SelfHost?

omerbalash commented 8 months ago

This is not a CefSharp exclusive issue

But why is it working well without SelfHost?

I am not sure. There isnt a SelfHost equivalent in C++. Moreover it looks like using the switch "use-angle" allows to also select both EGL and GLES as a workaround. it looks like in certain conditions the default value doesnt work.