Error Canvas and webgl

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

Error Canvas and webgl

Postby totti240282 » Fri Sep 24, 2021 2:12 am

On servers that don't have gpu, from version v93 (I'm using the samp project, the application) if I use this command in console:


Code: Select all
var canvas = document.createElement('canvas');
var gl = canvas.getContext('webgl');
gl is null


With v92 all is ok.
totti240282
Techie
 
Posts: 16
Joined: Fri Oct 25, 2019 3:16 am

Re: Error Canvas and webgl

Postby magreenblatt » Fri Sep 24, 2021 2:21 am

What OS? Are you including the “swiftshader” folder?
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Error Canvas and webgl

Postby amaitland » Fri Sep 24, 2021 2:24 am

Check the log file https://github.com/cefsharp/CefSharp/wi ... g#log-file

It's possibly related to https://bitbucket.org/chromiumembedded/ ... dll-vulkan

Try the following command line arg
Code: Select all
--use-gl=swiftshader
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Error Canvas and webgl

Postby totti240282 » Fri Sep 24, 2021 8:01 am

Now I try thanks.
totti240282
Techie
 
Posts: 16
Joined: Fri Oct 25, 2019 3:16 am

Re: Error Canvas and webgl

Postby totti240282 » Fri Sep 24, 2021 8:15 am

totti240282
Techie
 
Posts: 16
Joined: Fri Oct 25, 2019 3:16 am

Re: Error Canvas and webgl

Postby amaitland » Fri Sep 24, 2021 2:29 pm

How does Chrome behave?
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Error Canvas and webgl

Postby totti240282 » Fri Sep 24, 2021 4:11 pm

Is ok.

and write ANGLE (Google, Vulkan 1.2.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver-5.0.0)'
totti240282
Techie
 
Posts: 16
Joined: Fri Oct 25, 2019 3:16 am

Re: Error Canvas and webgl

Postby totti240282 » Fri Sep 24, 2021 4:27 pm

Code: Select all
var gl = canvas.getContext('webgl');
                    var debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
                    var currentRender = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);


with cef >= 93 return null.
totti240282
Techie
 
Posts: 16
Joined: Fri Oct 25, 2019 3:16 am

Re: Error Canvas and webgl

Postby amaitland » Fri Sep 24, 2021 4:47 pm

Did you test cefclient using --use-gl=swiftshader
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: Error Canvas and webgl

Postby totti240282 » Sat Sep 25, 2021 3:52 am

amaitland wrote:Did you test cefclient using --use-gl=swiftshader



Now is ok, but

var gl = document.createElement('canvas').getContext('webgl');
var debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
var currentRender = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);



currentRender in CEF is "Google SwiftShader", in Chrome "ANGLE (Google, Vulkan 1.2.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver-5.0.0)"

Is there any way to make them the same?

Thanks.
totti240282
Techie
 
Posts: 16
Joined: Fri Oct 25, 2019 3:16 am

Next

Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 17 guests