Diving deeper - EngineInstrumentation info not up-to-date?

This section of the doc seems a bit out of date?

  • Chrome nowadays seems to be exposing disjoint_timer_query extensions on platforms with Site Isolation (see for example this). That is the case in my environment, where the Playground example seems to work, BABYLON.Engine.LastCreatedEngine.getCaps().timerQuery returns EXTDisjointTimerQueryWebGL2 instead of null, EXT_disjoint_timer_query_webgl2 is listed as a supported extension, etc.
  • in Firefox on the other hand, enabling gfx.webrender.debug.gpu-time-queries doesn’t work for me. I have also tried enabling webgl.enable-privileged-extensions (suggested for example here), but that just crashes the tab with the PG in it.

If someone has suggestions for getting this to work in FF, I’ll take them! :slight_smile:

My environment:

  • Firefox 91.2.0esr
  • Chrome 95.0.4638.54
  • CentOS 8.4.2105

Trying to dig into this, Edge and Chrome are also working nicely for my Windows 10 machine (both pass WebGL EXT_disjoint_timer_query Conformance Tests fine), while Firefox fails.

This page last updated in 2020 EXT_disjoint_timer_query WebGL extension - Chrome Platform Status (chromestatus.com) is saying that Firefox has given no signal on supporting it, found the original PR removing it from Firefox with seemingly no followup: 1442504 - Disable disjoint timer queries to prevent use as a high-precision timer (mozilla.org). Weirdly, the support info in caniuse seems pretty out of date, looks like they forgot the extension even exists, lol: EXT_disjoint_timer_query API | Can I use… Support tables for HTML5, CSS3, etc.

I’ll try adding the Conformance Test link on the documentation, seems like more up-to-date way to show compatibility.

@RaananW @sebavan do you think we should do anything different for instrumentation on Firefox? Or that is on them to add support back?

1 Like

Thanks @carolhmj!

When I run the WebGL EXT_disjoint_timer_query Conformance Tests in Firefox I get …

PASS WebGL context exists
PASS No EXT_disjoint_timer_query support -- this is legal
PASS successfullyParsed is true


… with beautiful green highlights screaming “All good!” :slight_smile:

I’m guessing that’s not what you see when your FF fails the tests?

I also noticed that caniuse was out of date on this one. It’s actually the second time this week that I find inaccurate info reported there regarding WebGL extensions :confused:
I reported the first issue already. I’ll report this one after my first cup of :coffee:

:coffee: - :heavy_check_mark:

Caniuse info for EXT_disjoint_timer_query might be accurate after all : the footnote clarifies why support was removed from all browsers (security reason). There is also a dedicated entry for EXT_disjoint_timer_query_webgl2 which does indicate support in Chrome. Absence of support so far for EXT_disjoint_timer_query_webgl2 in Firefox is also confirmed here.

For other browsers I’m not sure.

:coffee: - Round 2!

I’ve tried activating again webgl.enable-privileged-extensions in FF, and dug a little more into this.

Additional observations:

  • EXT_disjoint_timer_query gets enabled, as advertised.
  • the default PG can still be opened without problem.
  • the PG in the doc crashes the tab. The line causing the crash is:
    instrumentation.captureGPUFrameTime = true;
  • after inspecting the source code for engine.query.ts and testing a bit, I think I narrowed down the cause of the crash to the calls to EXT_disjoint_timer_query.deleteQueryEXT()
  • in Chrome, those calls are not made. (gl.deleteQuery() is used instead.)
  • searching for more info made me circle back to the WebGL conformance tests (where I should have started… :man_facepalming:). The WebGL EXT_disjoint_timer_query conformance tests suggested by @carolhmj also crash the tab.

So that looks like a bug in Firefox, which I have reported here.

1 Like

Sorry, trying to follow the thread :slight_smile:

Is there something we need to do differently? If I ready correctly there seems to be a bug in firefox?

Yeah sorry, I sort of turned that thread into a documentation of the troubleshooting process.

It looks like the doc has been modified since my first post, so I guess what could be done on the Babylon side has now been done?

The bug found in FF was just a by-product of the troubleshooting exercise :slight_smile: