https://bugs.winehq.org/show_bug.cgi?id=45932
Bug ID: 45932 Summary: Assassin's Creed gameplay freezes after looking around with mouse Product: Wine Version: 3.16 Hardware: x86-64 OS: Linux Status: NEW Keywords: regression Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: andrey.goosev@gmail.com CC: awesie@gmail.com Regression SHA1: 580ea44bc65472c0304d74b7e873acfb7f680b85 Distribution: ---
It takes around 1-2 sec. and freezes.
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #1 from Andrew Wesie awesie@gmail.com --- Is this Assassin's Creed on Steam? And dx9 or dx10 version?
I installed the game and was able to play through the tutorial without issue, so any additional information would be helpful (e.g. what graphics card / driver, console log, etc.).
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #2 from Andrey Gusev andrey.goosev@gmail.com --- DX10 doesn't work, so it's in DX9 mode. Yes, tutorial works for me too. Freeze happens in Memory Block 3. Output without debugging doesn't show any errors or warnings. GPU is GTX 1060, driver 396.54.
https://bugs.winehq.org/show_bug.cgi?id=45932
mrdeathjr28@yahoo.es changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mrdeathjr28@yahoo.es
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #3 from Andrew Wesie awesie@gmail.com --- Created attachment 62465 --> https://bugs.winehq.org/attachment.cgi?id=62465 Hack to always flush
I haven't been able to trigger it myself but based on the game's usage of queries I think the problem is that queries are not getting flushed correctly. The confusing part is that I am not sure yet that this is a bug in the new code, it may just be that a bug elsewhere got exposed.
Can you try this hack to see if it fixes the problem? If so, I have better patch that I'll have you try afterwards.
https://bugs.winehq.org/show_bug.cgi?id=45932
Andrew Wesie awesie@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #62465|0 |1 is obsolete| |
--- Comment #4 from Andrew Wesie awesie@gmail.com --- Created attachment 62466 --> https://bugs.winehq.org/attachment.cgi?id=62466 Better hack
Oops, previous hack also destroyed performance. This is the better version that may or may not be effective.
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #5 from Andrey Gusev andrey.goosev@gmail.com --- Still the same with the hack.
https://bugs.winehq.org/show_bug.cgi?id=45932
Andrew Wesie awesie@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #62466|0 |1 is obsolete| |
--- Comment #6 from Andrew Wesie awesie@gmail.com --- Created attachment 62468 --> https://bugs.winehq.org/attachment.cgi?id=62468 Flush queries whenever cs is empty
If you could try this one instead, I would appreciate it. I'm trying to avoid buying a NVIDIA card just to fix this.
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #7 from Andrey Gusev andrey.goosev@gmail.com ---
Created attachment 62468 [details] Flush queries whenever cs is empty
Still no luck.
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #8 from Andrew Wesie awesie@gmail.com --- Ok, thanks. I bought a NVIDIA card to test. Once it shows up I'll come back to this bug. (Or if another developer gets to it before then, all the merrier.)
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #9 from Andrey Gusev andrey.goosev@gmail.com --- Spintires: MudRunner is also affected in another way. No freezes. Screen periodically flashes black for 1 sec. during gameplay.
fixme:d3d:wined3d_debug_callback 0x13e2018: "Program undefined behavior warning: The current GL state uses a sampler (12) that has depth comparisons enabled, with a texture object (268) with a depth format, by a shader that samples it with a non-shadow sampler. Using this state to sample would result in undefined behavior".
https://bugs.winehq.org/show_bug.cgi?id=45932
Andrew Wesie awesie@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #62468|0 |1 is obsolete| |
--- Comment #10 from Andrew Wesie awesie@gmail.com --- Created attachment 62502 --> https://bugs.winehq.org/attachment.cgi?id=62502 Patch to use barrier and sync after query
Another shot in the dark.
The test data (http://test.winehq.org/data/f11563c65fa50e2f8b7e39cade34bb7a998b26f7/linux_c...) shows a regression on NVIDIA gpus with the query buffer patch. I'm still waiting to get one in my hands since the tests do not show any regression on AMD.
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #11 from Andrey Gusev andrey.goosev@gmail.com ---
Created attachment 62502 [details] Patch to use barrier and sync after query
No changes.
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #12 from Andrew Wesie awesie@gmail.com --- Confirmed with wine-3.17 and GTX 1070 with NVIDIA 390.77. The game constantly polls for the query data which never shows up.
https://bugs.winehq.org/show_bug.cgi?id=45932
Andrew Wesie awesie@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #62502|0 |1 is obsolete| |
--- Comment #13 from Andrew Wesie awesie@gmail.com --- Created attachment 62529 --> https://bugs.winehq.org/attachment.cgi?id=62529 Workaround for NVIDIA
This may be due to a driver error. With Assassins Creed and query buffer objects it is seems to be easy to make the gpu unhappy. This error shows up in dmesg:
Xid (PCI:0000:01:00): 32, Channel ID 00000023 intr 00040000
Avoiding concurrent writes to the same buffer object appears to help, but it is possible that it is just reducing the chance of error instead of eliminating it.
This patch reverts to using a random value to indicate an invalid value. It also uses glBufferStorage to initialize the buffer and eliminates any CPU writes to the buffer.
https://bugs.winehq.org/show_bug.cgi?id=45932
Józef Kucia joseph.kucia@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |joseph.kucia@gmail.com
--- Comment #14 from Józef Kucia joseph.kucia@gmail.com --- I think our usage of query buffer objects might be invalid, e.g. the OpenGL spec says:
"If MAP_COHERENT_BIT is set and the server does a write, the applica- tion must call FenceSync with SYNC_GPU_COMMANDS_COMPLETE (or Finish). Then the CPU will see the writes after the sync is complete."
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #15 from Andrew Wesie awesie@gmail.com --- (In reply to Józef Kucia from comment #14)
I think our usage of query buffer objects might be invalid, e.g. the OpenGL spec says:
"If MAP_COHERENT_BIT is set and the server does a write, the applica- tion must call FenceSync with SYNC_GPU_COMMANDS_COMPLETE (or Finish). Then the CPU will see the writes after the sync is complete."
Thanks for reminding me of that.
This new patch hopefully resolves the issue on NVIDIA then. It looks a bit strange, e.g. we issue a fence then immediately delete it, but that is all that is required from my testing.
https://bugs.winehq.org/show_bug.cgi?id=45932
Andrew Wesie awesie@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #62529|0 |1 is obsolete| |
--- Comment #16 from Andrew Wesie awesie@gmail.com --- Created attachment 62534 --> https://bugs.winehq.org/attachment.cgi?id=62534 Patch to issue a fence after query
https://bugs.winehq.org/show_bug.cgi?id=45932
--- Comment #17 from Andrey Gusev andrey.goosev@gmail.com ---
Created attachment 62534 [details] Patch to issue a fence after query
Works flawlessly, thanks!
https://bugs.winehq.org/show_bug.cgi?id=45932
Andrey Gusev andrey.goosev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |6f5b8265abb42f963fefaa5c3f5 | |326ad6d047ebc Status|NEW |RESOLVED
--- Comment #18 from Andrey Gusev andrey.goosev@gmail.com --- Fixed by https://source.winehq.org/git/wine.git/commit/6f5b8265abb42f963fefaa5c3f5326...
https://bugs.winehq.org/show_bug.cgi?id=45932
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #19 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 3.19.