VSync Off not working?

Hi,

Mostly out of curiosity I was playing around with the vsync settings in the Nvidia control panel and it seems like it’s not possible to switch it off.

When the vsync is “on”, I get the expected 60fps/16ms frame time.
When vsync is set to “adaptive” I get a slightly worse 17ms frame time.
Set it to “fast”, and I get an 8ms frame time.
But setting it to “off” gives me the same as when it’s on - 16ms frame time.

I’m calling IDXGISwapChain1::Present1 with 0, 0, { 0, nullptr, nullptr, nullptr } with a DX11 renderer on Windows 10 and a GTX 1650 Nvidia GPU. Nsight Graphics shows my actual GPU time is less than 0.5ms - it’s a pretty simple scene with just a few draw calls, so I would expect to see something comparable when disabling vsync in the control panel.

Only I don’t.

Does anyone have any insights as to what is going on? Or is this just a driver bug?

Cheers,
James

Hi James!

What kind of monitor are you using? Looking at the VSync On number I would guess it is a 60Hz panel. So if you have a very simple scene with VSync off I would expect the renderer to max out on the maximum refresh rate of the monitor, which seems to be 60Hz.

The “fast” option simply overrides the panel limitations on the render process, it will not be able to actually present more than 60 frames per second to the panel.

And “adaptive” doing 17ms frame time looks like a rounding issue since 60Hz is one frame every 16,666… ms

I hope that helps.

Hi Markus,

It probably is a 60Hz panel. But I’m deliberately specifying in the Present call not to wait for the vsync, and I’ve deliberately switched off vsync in the control panel. I would expect the renderer to run as fast as it can.

I guess I’m just disappointed it doesn’t.

Cheers,
James

Now you got me curious as well. There are more things to factor in here beside just the monitor refresh rate. Maybe you would be willing to share your simple rendering test so I could try to reproduce?

And then also the question of how do you measure frame time/FPS? Do you use Nsight for that as well?

Hi Markus,

This is the moment where I remind myself (and everyone here) that I’m an idiot, and you all have a good laugh at my expense.

I dug into this properly this evening and discovered…

At some undisclosed point in the past I was debugging something. Judging by what I found it was probably a race condition or something similar that I was having trouble tracking down. Because the discovery was an innocuous little Sleep() call deep in my engine where it shouldn’t have been.

I guess I might have discovered this eventually but the jury’s still out on that.

But anyway, removing that call increased the frame rate by about 800fps - which is still lower than I think it should be, but at least I’m reasonably confident that it’s my problem and nobody else’s.

Cheers,
James

If I had a penny for every time I did a mistake like that…

No reason to beat yourself up over that, it happens to every developer more than once in their career.

Good to know that you can now progress in your project!