MoltenVK performance regression in Windows games with DXVK
Qotonana opened this issue · comments
Since 1.2.11 MoltenVK has MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS enabled by default but this degrades performance in DX11 games run with DXVK through CrossOver.
Are Metal Argument Buffers of use only for dx12 level features and irrelevant for dx11, or there are some changes needed to be done on the Mac DXVK implementation (heavily patched but used to run many games anyway) or MoltenVK?

Automobilista 2 “MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS” = “1” (default) added in cxbottle.conf - DXVK/MSync enabled 20 FPS

Automobilista 2 “MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS” = “0” added in cxbottle.conf - DXVK/MSync enabled 36 FPS

Skyrim SE “MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS” = “1” (default) added in cxbottle.conf - DXVK/MSync enabled 31 FPS

Skyrim SE “MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS” = “0” added in cxbottle.conf - DXVK/MSync enabled 46 FPS
All tests on CrossOver, MacOs Sequoia 15.4.1 Intel Mac with AMD card
Latest MoltenVK 1.31 dylib from releases
DXVK Mac from https://github.com/Gcenx/DXVK-macOS/releases
(unpackaged dx11 putted in game folder with native/ built in wine cfg override and replaced libMoltenVK dylib (UNSUPPORTED - JUST FOR TESTING PURPOSES).
Also Vulkan is now reported as Vulkan 1.1 in DXVK HUD. Before 1.30rc1 correct Vulkan version was shown.
Have you compared against previous versions of MoltenVK also downloaded from here? As I recall the versions that ship with CrossOver are patched. Would be interesting to know if the performance decreased from a previous version or not.
Have you compared against previous versions of MoltenVK also downloaded from here? As I recall the versions that ship with CrossOver are patched. Would be interesting to know if the performance decreased from a previous version or not.
Codeweavers MoltenVK is based on 1.2.10 (Driver 0.2.2018, Vulkan 1.2.290 from DXVK HUD - same as 'stock' GitHub release 1.2.10) which doesn't have Metal Argument Buffers enabled.
They probably have some additional patches (for example 'geometryshader' from Sasha Willems examples work only with Codeweavers default MoltenVK) and optimisations as that version usually have 5-10% better performance

Skyrim V SE Codeweavers CrossOver default MoltenVK based on 1.2.10
Driver 0.2.2018, Vulkan 1.2.290 from DXVK HUD 48 FPS (100% GPU utilisation)

Skyrim V SE GitHub MoltenVK release 1.2.10
Driver 0.2.2018, Vulkan 1.2.290 from DXVK HUD 44 FPS (92% GPU utilisation)

Skyrim V SE GitHub MoltenVK release 1.2.11
Driver 0.2.2019, Vulkan 1.2.296 from DXVK HUD 31 FPS (70% GPU utilisation)
Disabling “MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS” = “0” in cxbottle.conf brings the results from GitHub MoltenVK 1.2.11 or 1.3.10 similar to 1.2.10
I can confirm the Metal ARGUMENT_BUFFERS issue with Talos Principle 1, but only with DXVK and DX11 renderer.
Setting MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS to 1 or 0 doesn’t noticeably affect benchmark result neither in Vulkan nor DX12 renderer in Talos Principle.
All 3 TP renderer engines now work in CrossOver without any visual glitches with MoltenVK 1.3.0 and up from GitHub release.
(With mvk 1.2.11 Vulkan renderer has visual bugs and glitches, dx11 has lower score and heavy stutter, and dx12 renderer doesn’t work)

Talos Principle DX11 46.6 FPS “MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS” = “0”
added in cxbottle conf

Talos Principle DX11 37.0 FPS “MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS” = “1”
added in cxbottle conf

Talos Principle VULKAN 45.1 FPS (work without visual glitches with MoltenVK 1.3.0)
Setting MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS to 1 or 0 doesn’t noticeably affect Vulkan benchmark
Vulkan renderer is the most stable and smooth unlike DXVK dx11 renderer which is prone to crashing and has microstutters_

Talos Principle DX12 26.8 FPS (now work with MoltenVK 1.3.0)
Setting MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS to 1 or 0 doesn’t noticeably affect dx12 benchmark
Built in Benchmark tool with 60 sec timeout settings used with MoltenVK 1.31 dylib from releases in all tests
Game can be better suitable for testing as it support Vulkan, DirectX11 and DirectX12 renderer (on Windows), Vulkan (Linux) and OpenGL (MacOs) and has a large number of console options. ( issue #2531 )
It seems that Talos Principle supports Metal on MacOs. It's buggy and needs adding Talos ini and to be run in windowed mode.
For comparison with CrossOver.
Same settings (2048x1152, MSAA 4x, vsyns disabled, performance - CPU speed MEDIUM, GPU speed ULTRA, GPU memory ULTRA)
Talos Principle METAL (MacOs Native) 58.6 FPS
There only 3 dx12 games that are known to work with VKD3d, Diablo 2:Resurrected, Diablo IV & Red Dead Redemption 2
All others will but running via D3DMetal
Learning DirectX 12 - Lesson 2 works with MoltenVK 1.3.0
Lesson 3 & 4 are crashing with this info
"vkd3d:00dc:fixme:d3d12_root_signature_init Ignoring root signature flags 0x1d."
https://github.com/jpvanoosten/LearningDirectX12/releases
But dx12 through vkd3d should be another issue.
There is a lot to absorb across many systems and multi-layer library structures here.
Can we summarize the discussion as it relates to MoltenVK, and specifically, MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS?
Am I correct in assuming that DXVK & DX11 probably don't require significant descriptor indexing, and that argument buffers can be disabled via env vars (or the API) for those environments?
And for DX12, which often may need significant descriptor indexing, there does not seem to be a performance issue with MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS. Is that correct?

