View Single Post
Old 03-15-12, 11:09 AM   #28
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

Originally Posted by brebs View Post
Could you post your patch, please?
It's a trivial one, really. Here is what I use to disable vsync control in wine-1.4+ (this patch should also apply to 1.3.28+ series, but likelly with a bit of fuzz):

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index fe26549..a7ed93b 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1464,7 +1464,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
             swap_interval = 1;

-    if (gl_info->supported[WGL_EXT_SWAP_CONTROL])
+    if (FALSE && gl_info->supported[WGL_EXT_SWAP_CONTROL])
         if (!GL_EXTCALL(wglSwapIntervalEXT(swap_interval)))
             ERR("wglSwapIntervalEXT failed to set swap interval %d for context %p, last error %#x\n",
With this patch in place you would essentially get vsync controlled by nVIDIA driver CP and not by wine and/or app running under it. If you want to force vsync ON for all Wine apps - don't apply the patch above, but rather just open wined3d/context.dll in your favorite text editor, head on to line 1469 and add "swap_interval = 1;" right before the line which calls wglSwapIntervalExt(). To force-disable vsync for Wine apps do just the same, but insert "swap_interval = 0;" instead.

Originally Posted by brebs View Post
I can't be the only Linux games-in-Wine-player who hates not being able to force vsync on
IMO the ability to control vsync system-wide by changing settings in driver CP is a must-have feature. It should be possible not only to force-enable vsync, but also to force-disable it. nVIDIA linux drivers leave us wishing for more in this regard. Sure, it can't be totally guaranted: if an app renders to an FBO and then maps its contents, reads em and directly memcpy() them to the framebuffer shadow memory region - there's nothing we can do about. But the chances that one would hit such an app are about zero, because almost every displaying app would end up showing its graphics on screen using "swap buffer" technique, either directly or using desktop compositing manager as a displaying proxy.
lexa2 is offline   Reply With Quote