I spent a bit of time today looking deeper into this. I added a log inside the AppBase._fillFrameStatsBasic
method to see what values I get inside
// total draw call
this.stats.drawCalls.total = this.graphicsDevice._drawCallsPerFrame;
console.log(`AppBase._fillFrameStatsBasic: (now: ${now}, dt: ${dt}, ms: ${ms}, dc: ${this.graphicsDevice._drawCallsPerFrame})`);
this.graphicsDevice._drawCallsPerFrame = 0;
And I got these values on the external monitor
app-base.js:549 AppBase._fillFrameStatsBasic: (now: 18921.917, dt: 0.016680000000000292, ms: 16.68000000000029, dc: 135)
app-base.js:549 AppBase._fillFrameStatsBasic: (now: 18938.597, dt: 0.016680000000000292, ms: 16.68000000000029, dc: 135)
app-base.js:549 AppBase._fillFrameStatsBasic: (now: 18955.277, dt: 0.016679999999996652, ms: 16.679999999996653, dc: 135)
the FPS on the external monitor is 60
but for the laptop display whose FPS is 120 I get this
app-base.js:549 AppBase._fillFrameStatsBasic: (now: 181221.862, dt: 0.008332999999984167, ms: 8.332999999984168, dc: 134)
app-base.js:549 AppBase._fillFrameStatsBasic: (now: 181230.195, dt: 0.00833300000001327, ms: 8.333000000013271, dc: 0)
app-base.js:549 AppBase._fillFrameStatsBasic: (now: 181238.528, dt: 0.008332999999984167, ms: 8.332999999984168, dc: 134)
app-base.js:549 AppBase._fillFrameStatsBasic: (now: 181246.861, dt: 0.00833300000001327, ms: 8.333000000013271, dc: 0)
app-base.js:549 AppBase._fillFrameStatsBasic: (now: 181255.194, dt: 0.008332999999984167, ms: 8.332999999984168, dc: 134)
the draw calls count (dc) is zero each other frame, this is the reason I’m getting half the number of draw calls, so it seem that the real draw call count it is the one on the external monitor.
I’ve also checked again with Spector and indeed the higher number is the good one and I’m getting that same number when capturing on both displays.
I added the same logging to the engine and ran the examples locally and they’re still showing the correct number all the time on both displays, there is no zero draw call count there.
Investigation continues…