Hello,
I have a cross-platform openGl application that works fine with most graphic cards. However, there are rare cases when rendering is very slow under following conditions:
- Linux (Ubuntu)
- Nvidia card (e.g. Nvidia NVS 5200 M)
The application runs a single thread (the main thread), and turns vsync off at the beginning (following is the Linux code to turn Vsync off):
typedef int (APIENTRY * AAAAGLSWAPINTERVALEXTPROC)(int);
AAAAGLSWAPINTERVALEXTPROC wglSwapIntervalEXT=(AAAAGLSWAPINTERVALEXTPROC)glXGetProcAddress((const GLubyte*)"glXSwapIntervalSGI");
if (wglSwapIntervalEXT)
{
wglSwapIntervalEXT(0);
}
Rendering gets very slow because following functions seems to be blocking for several ms even with an almost empty scene content:
openglWidget->swapBuffers(); // Qt command
or/and
openglWidget->doneCurrent(); // Qt command
It seems that VSync could not be turned off! More strange is that following command:
export __GL_SYNC_TO_VBLANK=1
improves the rendering speed (but still takes around 40-50 ms for each frame).
what is going on here? Other platforms or other graphic cards do not have any problem at all. It is critical to be able to render as quickly as possible (disable vsync) for various reasons (e.g. rendering for generation of movie files).
Thanks for any insight!!