MR !607 was trying to fix an issue with Life Is Strange Remastered, but
although it fixed some race conditions with presentation end, the issue
it was trying to fix is still there.
The game calls IMFMediaSession_Stop while the presentation is ending, expects
that command to quickly execute, interrupting the presentation end and
emitting a MESessionStopped event instead of the MESessionEnded.
Delaying the Stop command and emitting the MESessionEnded event breaks
the game assumptions and it crashes.
--
v3: mf: Discard end of presentation on IMFMediaSession_Stop.
mf/tests: Test IMFMediaSession_Stop command near presentation end.
mf/tests: Test Start / Pause / Stop IMFMEdiaSession events.
mf/tests: Split wait_media_event helper into wait_next_media_event.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1710
--
v3: include/msvcrt: Add __WINE_(ALLOC_SIZE|DEALLOC|MALLOC) attributes to _aligned_malloc functions.
include/msvcrt: Add __WINE_(DEALLOC|MALLOC) attributes to _strdup and _wcsdup.
msvcp140_atomic_wait: Don't use the reserved variable name 'environ'.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1686
Manual tests on Windows 10 show that calling Sleep(0) or NtDelayExecution() with zero timeout in a
loop do consume 100% of a CPU core, which is closer to the behavior of NtYieldExecution() than
usleep(0). usleep(0) gives up the remaining timeslices even if there are no other threads to switch
to, causing low utilization of CPU and performance issues.
The original patch is b1a79c6 and the idea is to use usleep(0) to avoid a thread taking 100% of a
CPU core for StarCraft 2 and Shadow of the Tomb Raider. However with wine-7.22, reverting the
usleep(0) patch causes no behavior changes. For Shadow of the Tomb Raider, the 100% CPU issue is
gone with or without the patch. For StarCraft 2, there is always a thread taking 100% CPU even with
the patch. After discussing with Matteo, we decided it's better to revert the patch.
Fix Mortal Kombat X performance drop during tower selection and Ragnarok Online bad performance.
This reverts commit e86b4015ff405d4c054b8a5bc855ee655e1a833c.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53327
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1715
MR !607 was trying to fix an issue with Life Is Strange Remastered, but
although it fixed some race conditions with presentation end, the issue
it was trying to fix is still there.
The game calls IMFMediaSession_Stop while the presentation is ending, expects
that command to quickly execute, interrupting the presentation end and
emitting a MESessionStopped event instead of the MESessionEnded.
Delaying the Stop command and emitting the MESessionEnded event breaks
the game assumptions and it crashes.
--
v2: mf: Discard end of presentation on IMFMediaSession_Stop.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1710
On Wed Dec 7 03:23:03 2022 +0000, Zebediah Figura wrote:
> > This is probably fine for simplicity, but note the existence of
> WINED3DPMISCCAPS_INDEPENDENTWRITEMASKS (and "NumSimultaneousRTs" more
> generally); this is not strictly a requirement for D3D 9.3.
> Is it not? [1] at least states it is. For d3d9 we'd presumably want to
> set WINED3DPMISCCAPS_INDEPENDENTWRITEMASKS appropriately (which,
> granted, I don't have a patch for yet) but in terms of setting feature
> levels it seems right?
> [1] https://learn.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct…
Oh, I was looking at the required features for Direct3D 9, not Direct3D 11 downlevel devices. For the most part that shouldn't matter too much, because we'll happily create a device with a lower feature level in d3d9, but we do restrict the maximum shader version based on the feature level (shader_max_version_from_feature_level()). I.e., AFAIK in d3d9 it should be possible to use shader model 3 shaders without having D3DPMISCCAPS_INDEPENDENTWRITEMASKS.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/1693#note_18956