Vsync without double buffer?

Started by
18 comments, last by JackOfAllTrades 12 years, 8 months ago
I'm using a frame buffer in my project and for this reason I don't believe a double buffer is necessarily anymore. I tried using glFinish before my draw call but it didn't stop tearing at all. Is there anyway I can do vsync without double buffer?
Advertisement
AFAIK, GL doesn't allow for you to replace the default back-buffer with your own frame buffer objects...

So you render to your FBO, then copy it to the back-buffer, and then the system copies it from there to the front buffer. I don't think there's a way around this on PC.

AFAIK, GL doesn't allow for you to replace the default back-buffer with your own frame buffer objects...

So you render to your FBO, then copy it to the back-buffer, and then the system copies it from there to the front buffer. I don't think there's a way around this on PC.


I can turn it off without a problem by just creating my context without a double buffer.

I tried using glFinish before my draw call but it didn't stop tearing at all.


How would it? It's not about being "done", it's about quickly swapping buffers at exactly the right time in sync with your screens refresh rate. glFinish has nothing to do with that and I doubt there is anything but the actual buffer swapping that does.
f@dzhttp://festini.device-zero.de
Does double-buffering actually cause you a problem? And if so, does it cause you more problems than you're currently getting by trying to avoid it?

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


Does double-buffering actually cause you a problem? And if so, does it cause you more problems than you're currently getting by trying to avoid it?


It hurts performance by a tinny bit and I need all I can get.

[quote name='mhagain' timestamp='1313423519' post='4849428']
Does double-buffering actually cause you a problem? And if so, does it cause you more problems than you're currently getting by trying to avoid it?


It hurts performance by a tinny bit and I need all I can get.
[/quote]

Uhm, you're sure it isn't vsync that is hurting your performance rather than double buffering?



[quote name='SteveDeFacto' timestamp='1313442307' post='4849567']
[quote name='mhagain' timestamp='1313423519' post='4849428']
Does double-buffering actually cause you a problem? And if so, does it cause you more problems than you're currently getting by trying to avoid it?


It hurts performance by a tinny bit and I need all I can get.
[/quote]

Uhm, you're sure it isn't vsync that is hurting your performance rather than double buffering?
[/quote]

I only assume double buffering hurts performance since it's a completely useless step...

[quote name='Syranide' timestamp='1313485938' post='4849765']
[quote name='SteveDeFacto' timestamp='1313442307' post='4849567']
[quote name='mhagain' timestamp='1313423519' post='4849428']
Does double-buffering actually cause you a problem? And if so, does it cause you more problems than you're currently getting by trying to avoid it?


It hurts performance by a tinny bit and I need all I can get.
[/quote]

Uhm, you're sure it isn't vsync that is hurting your performance rather than double buffering?
[/quote]

I only assume double buffering hurts performance since it's a completely useless step...
[/quote]

Don't assume; benchmark and base your conclusion on actual measured facts instead.

You're getting seriously into the realm of micro-optimizing here. GPUs have been swapping buffers for over 15 years now; you can bet anything you like that this is one seriously optimized process (depending on various factors, it could be as simple as exchanging two pointers). It's also highly likely that you have much higher bottlenecks in your program than use of double-buffering; it would be a far more productive use of your time to tackle those instead.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


I only assume double buffering hurts performance since it's a completely useless step...


It's not useless at all. You can't just have the GPU render onto the front buffer, since that buffer is being used for scan-out to the display. The point of the backbuffer is to give you a surface that the GPU can access while the front buffer is being displayed. Then you swap, and keep going.

This topic is closed to new replies.

Advertisement