webgl performance warnings

24 views
Skip to first unread message

Siddharth Palaniappan

unread,
Nov 12, 2021, 6:43:48 PM11/12/21
to WebGL Dev List
hello webgl folks!

I'm looking for a way to capture performance warnings from the webgl driver that somehow gets logged on to the browser console. I'm using google chrome. I’m also using threejs instead of webgl directly.. In desktop opengl, you have message callbacks that you can attach to a context and describe a verbosity level for performance degradation warnings.

Is there something like that in webgl, where i can query the context for bad performance notifications. 

I see that when creating a webgl context, you can use a flag ‘failIfMajorPerformanceCaveat’.. however i see a case (with google's swiftshader software implementation), if you disable, GPU acceleration in chrome, even when passing this flag to true, returns a non null wgl context but with horrible performance

Hence my thought if i can ‘listen’ to the webgl context for any driver level warnings for low performance.

i appreciate any guidance here!

thank you,

Sid

Ken Russell

unread,
Nov 12, 2021, 6:55:29 PM11/12/21
Hi Sid,

The best way for you to identify this scenario would be to use the WEBGL_debug_renderer_info extension, where available, and detect the use of SwiftShader or Mesa/llvmpipe yourself. I don't think the WebGL implementation will signal even to the JS console that performance is expected to be low, and if it did, I don't think the JS app can interpose on that to receive it programmatically.

You can also measure performance in your app and warn the user if the framerate appears to be unacceptable. However, I'd caution against preventing users from accessing your content simply based on low frame rate; there can be other reason this happens, including heavy load on the system. Sometimes situations like this are recoverable, and you wouldn't want your app feeling "fragile".

-Ken

P.S. Sorry for slow reply; the moderation notifications for new posters went into my spam folder.



--
You received this message because you are subscribed to the Google Groups "WebGL Dev List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/webgl-dev-list/1ad68030-51c4-4f73-8f70-f237123f81f0n%40googlegroups.com.

Siddharth Palaniappan

unread,
Nov 14, 2021, 12:25:56 PM11/14/21
to WebGL Dev List
Hi Ken,

Thank you for answering me. Yes I already use WEBGL_debug_renderer_info but was trying to see if i can have a generalized solution. Just out of curiosity, do you know of any resource online that lists out webgl software rasterizers for different browsers?

Yeah, I agree about your caution against measuring performance as well.

Thanks

Sid

Ken Russell

unread,
Nov 18, 2021, 2:32:12 AM11/18/21
I'm not aware of an online resource describing all software rasterizers that might be used in WebGL implementations. Representatives from all browser vendors are on this list, so perhaps they can offer hints. Not sure all said browsers support the WEBGL_debug_renderer_info extension, though.

-Ken



Siddharth Palaniappan

unread,
Nov 20, 2021, 7:11:46 PM11/20/21
to WebGL Dev List
thank you ken!
Reply all
Reply to author
Forward
0 new messages