View Single Post
Old 03-16-12, 07:18 PM   #31
lexa2
Registered User
 
Join Date: Jul 2011
Location: Moscow, Russian Federation
Posts: 58
Send a message via ICQ to lexa2 Send a message via Skype™ to lexa2
Default Re: Wine + VSync forced in nvidia-settings doesn't work

Quote:
Originally Posted by brebs View Post
This patch seems to work, to force vsync on in wine 1.4
Sure, this one should work, and it would force vsync on both for OpenGL and direct3d apps under wine. As you had hardcoded swap_interval == 1 into the WGL_EXT_swap_control implementation there's no point in hardcoding it inside wined3d.

With the hardcode approach you've got a bug here: WGL offers a way to read back current swap_interval, and Wine implements it internally inside X11DRV_wglGetSwapIntervalEXT(), tracking the value being set inside swap_interval variable. In case an app requests swap_interval != 1 and then reads back it using wglGetSwapIntervalEXT() - it would read back the value it had previously being set, i.e. with your patch Wine essentially lies to the app about real vsync state. That's a bad thing cause some apps have got built-in detection for the driver ability to set swap_interval, and might then base their timing on an assumption that having swap_control == 0 the execution wouldn't be "paused" as every swap buffers call - which is not the case. If you happen to hit such an app - you would get huge input lags problems. So, the solution is either to hardcode 1 as the return value for wglGetSwapIntervalEXT() or to add line "interval = 1;" just prior the line "wine_tsx11_lock();" inside X11DRV_wglSwapIntervalEXT(). Well, enough of this programming stuff, it's a bit offtopic in this thread actually :-).
lexa2 is offline   Reply With Quote