I created a second window as done in the BasicAppMultiWindow sample. And my framerate dropped in half. Do you know why that is? Maybe because of the constant switching between the 2 GL contexts?
Wild guess: if you’re not issuing any draw calls and the frame rate still drops, it might be caused by vertical sync. If both windows wait for vertical sync, you effectively cut the frame rate in half.
Thanks, that makes sense.
My data so far:
- 1 window with vsync on: 25 fps
- 1 window with vsync off: 29 fps
- 2 windows with vsync on: 15fps
- 2 windows with vsync off: 20fps
So that kinda helped, but not completely.
Indeed I’m not issuing any draw calls in the second window - only in the first one.
I tried disableFrameRate(), didn’t help.
It turns out that before, I had only disabled vsync for one of the windows.
Now I disabled it for both windows and got 24 fps - basically like the “1 window with vsync on” scenario.
Well, of course that’s not much of a solution, because now I’m getting tearing.
Btw, I’m on Windows 10 with a nvidia gpu.
I did what you said here, @paul.houx:
NVIDIA users should:
- either enable vertical sync, enable triple buffering, disable threaded optimization
- or disable vertical sync, disable triple buffering, enable threaded optimization
The first option didn’t help.
The second one caused tearing again.