Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 11-02-06, 04:57 AM   #1
brasse
Registered User
 
Join Date: Nov 2006
Posts: 2
Question Syncing on every other vblank

Hello!

I have question for you regarding vblank syncing. I know that if I set the environment variable __GL_SYNC_TO_VBLANK to non-zero value I get my application to sync to the vblank when I go glXSwapBuffers(). Now what I want to do is sync to every other vblank (if the vblank is 60 Hz, I want my application to run at 30 FPS).

Initially I thought that this would be easy. My guess was that if I call glXSwapBuffers() with an interval of more that 1000/60 ms I would get an FPS of 30. This seemed reasonable since I get a FPS of 60 if I call glXSwapBuffers() with an interval less than 1000/60 ms. However, for my particular application I get an FPS around 43 (the time it takes to draw all my stuff is ~23 ms).

Does anyone here know if there is a way to make the driver always sync to the next vblank, even if my call to glXSwapBuffers() comes a bit late?

Regards,
Mattias
brasse is offline   Reply With Quote
Old 11-02-06, 10:36 AM   #2
lcs
Registered User
 
Join Date: Aug 2003
Posts: 14
Default Re: Syncing on every other vblank

GLX_SGI_swap_control or perhaps GLX_SGI_video_sync?
lcs is offline   Reply With Quote
Old 11-02-06, 12:56 PM   #3
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Syncing on every other vblank

Try __GL_SYNC_TO_VBLANK=2
AaronP is offline   Reply With Quote
Old 11-03-06, 03:47 AM   #4
brasse
Registered User
 
Join Date: Nov 2006
Posts: 2
Default Re: Syncing on every other vblank

Thanks. Setting __GL_SYNC_TO_VBLANK=2 works perfectly! I haven't seen it documented anywhere, but it works! :-)

:.:: mattias
brasse is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:12 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.