Jump to content
  • Advertisement
Sign in to follow this  

Vsync without double buffer?

This topic is 2468 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

[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?

Share this post


Link to post
Share on other sites

[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...

Share this post


Link to post
Share on other sites

[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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!