[Bug 39911] New: dxd9 PresentationInterval not propagated on device Reset
https://bugs.winehq.org/show_bug.cgi?id=39911 Bug ID: 39911 Summary: dxd9 PresentationInterval not propagated on device Reset Product: Wine Version: 1.9.0 Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs(a)winehq.org Reporter: zakk(a)rsdio.com Background: The steam game XIIZeal relies on vsync to run the game engine timing; under wine (on OSX) fullscreen runs at an unlimited speed, while on windows it runs at the refresh rate of your display. Looking into this this is the sequence of events as best I can tell: It creates a D3D9 Device with PresentationInterval set to D3DPRESENT_INTERVAL_IMMEDIATE Wine creates the device, swap chain, OpenGL context and eventually calls wglSwapInterval(0). Then the game does a device Reset, in that reset the PresentationInterval is set to D3DPRESENT_INTERVAL_ONE. Wine does not ever call wglSwapInterval(1) after this reset, thus the framerate is never limited. If I hack up wined3d_device_reset() to call wglSwapInterval() based on the PresentationInterval the game behaves as expected. However I don't know if this is the best way to approach this issue. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 --- Comment #1 from Zakk <zakk(a)rsdio.com> --- Created attachment 54103 --> https://bugs.winehq.org/attachment.cgi?id=54103 Change swapinterval in device_reset This is the patch I'm using to work around this issue. It works but I'm not sure if there's a better place to put this logic. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 --- Comment #2 from Henri Verbeet <hverbeet(a)gmail.com> --- Is wined3d_device_reset() getting called from d3d9ex by any chance? context_create() (called from create_primary_opengl_context()) should take care of setting up the swap interval, but if wined3d_device_reset() gets called with "reset_state" FALSE that never happens. We'll probably want to introduce a function context_set_swap_interval() and call that from both context_create() and wined3d_device_reset(). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 --- Comment #3 from Zakk <zakk(a)rsdio.com> --- Yes, now that I look deeper the game is creating the device with Direct3DCreate9Ex, so that explains the lack of swap interval change on reset -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 --- Comment #4 from Henri Verbeet <hverbeet(a)gmail.com> --- Created attachment 54110 --> https://bugs.winehq.org/attachment.cgi?id=54110 patch Does this patch help? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 --- Comment #5 from Zakk <zakk(a)rsdio.com> --- Yep, that fixes the issue -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 Henri Verbeet <hverbeet(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |6b8fb1c22ea26f9fafda7613385 | |0af10ac3c7256 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #6 from Henri Verbeet <hverbeet(a)gmail.com> --- Should be fixed by commit 6b8fb1c22ea26f9fafda76133850af10ac3c7256. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #7 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 1.9.8. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 Michael Stefaniuc <mstefani(a)redhat.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani(a)redhat.com Target Milestone|--- |1.8.x -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 --- Comment #8 from Michael Stefaniuc <mstefani(a)redhat.com> --- Henri, is it worth backporting this patch to Stable? It depends on commit e3e5dcd2cd548bed34cc193383da96c1898fee2c Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Mar 2 19:24:13 2016 +0100 wined3d: Use a single allocation for texture sub-resource objects. which has a huge dependency list. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 --- Comment #9 from Henri Verbeet <hverbeet(a)gmail.com> --- (In reply to Michael Stefaniuc from comment #8)
Henri, is it worth backporting this patch to Stable? It depends on
commit e3e5dcd2cd548bed34cc193383da96c1898fee2c Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Mar 2 19:24:13 2016 +0100
wined3d: Use a single allocation for texture sub-resource objects.
which has a huge dependency list.
It shouldn't be hard to backport. At first sight, it's probably just the second argument to the context_acquire() call in swapchain_update_swap_interval(). You should be able to just replace that with something like "surface_from_resource(swapchain->front_buffer->sub_resources[0])". -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=39911 Michael Stefaniuc <mstefani(a)redhat.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.8.x |--- --- Comment #10 from Michael Stefaniuc <mstefani(a)redhat.com> --- Removing 1.8.x milestone from bugs included in 1.8.4. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org