Hello,
I have test application that periodicaly rendering scene when new data arive. Scene contains one quad with one texture no lights, no shaders. In each render i update texture with glTexSubImage2D (512B) one line of scene and call swapbuffers but call takes long time. “Long time” means longer time on Windodw7 laptop than on Windows XP laptop - i developed application on this pc.
PC WIN_XP: DualCore, ATI MOBILITY RADEON 38500
SwapBuffers takes 5ms
Where can be problem? Why is SwapBuffers has so bad performence on better pc? Is it problem in WIN7/WINXP on NVIDIA/ATI?
Is there any general recommendation to discover this discrepancy?
NVIDIA drivers by default synchronize swaps to vblank, ATI driver do not. The 20ms look like vblank synchronization is enabled.
You can change the synchronization on swap using the WGL_EXT_swap_control extension or the control panel of the driver.
Thank you to your advice. Vsync disabling working in graphics card control panel only. But not from code.
How to disable Vsync throught the code? Where is mistake?
My code is this:
//Initialiaztion
hdc = GetDC(MainPanel->Handle);
SetPixelFormatDescriptor(hdc);
hrc = wglCreateContext(hdc);
wglMakeCurrent(hdc, hrc);
SetPixelFormatDescriptor(hdc);
typedef BOOL (APIENTRY *PFNWGLSWAPINTERVALFARPROC)( int );
If the graphics card control panel is set to something like “force vsync on” or “force vsync off”, you won’t be able to turn it on and off in code. Only if it is “application controlled” will the code work.