DXVK 2.0 (A Vulkan-based translation layer for DX 9/10/11)

Discussion in 'General Software and Applications' started by SpajdrEX, Aug 13, 2020.

  1. Krteq

    Krteq Maha Guru

    Messages:
    1,130
    Likes Received:
    765
    GPU:
    MSI RTX 3080 WC
    DXVK 1.9.4 released with some fixes and optimizations for God of War

     
    Last edited: Jan 25, 2022
  2. Krteq

    Krteq Maha Guru

    Messages:
    1,130
    Likes Received:
    765
    GPU:
    MSI RTX 3080 WC
    DXVK 1.10 released will some performance improvements and fixes

     
    Last edited: Mar 4, 2022
    HD64G, GSDragoon, Valken and 5 others like this.
  3. PhazDelta

    PhazDelta Master Guru

    Messages:
    895
    Likes Received:
    965
    GPU:
    RX6900XT Strix LC
    Last edited: Mar 30, 2022
    HD64G likes this.
  4. OnnA

    OnnA Ancient Guru

    Messages:
    17,846
    Likes Received:
    6,739
    GPU:
    TiTan RTX Ampere UV
    HD64G, chinobino and Valken like this.

  5. rodrigoles

    rodrigoles Master Guru

    Messages:
    226
    Likes Received:
    20
    GPU:
    Rx 5600 XT
    I just tried DXVK 1.10 async with The Witcher 3 and I do believe it helped alot with the constant hitching and stutter, it's smoother for sure, but with DXVK there's a 15~20fps penalty. Is this the tradeoff or there's something I should enable/disable in the settings?
     
  6. aufkrawall2

    aufkrawall2 Ancient Guru

    Messages:
    4,352
    Likes Received:
    1,814
    GPU:
    7800 XT Hellhound
    Often performance hit is lower with RADV vs. AMDVLK/Windows. Also, SAM should be activated.
     
  7. StreamWhenGuy

    StreamWhenGuy Guest

    Messages:
    3
    Likes Received:
    0
    GPU:
    Nvidia 1660 6GB
    Can someone translate this to common English tongue for non-tech savvy generic people who play video games? Thanks.
     
  8. HD64G

    HD64G Active Member

    Messages:
    90
    Likes Received:
    39
    GPU:
    SapphireRX6750ΧΤ
    Try the new driver from AMD that greatly lowers the overhead for DX11. It allowed my PC to go from 130 to 140FPS in Witcher 3 without any change. DXVK isn't needed any more with this one installed me thinks.
     
    Last edited: May 13, 2022
    GSDragoon likes this.
  9. Cryio

    Cryio Master Guru

    Messages:
    683
    Likes Received:
    298
    GPU:
    Nitro+ 7900 XTX
    It's been a while now since a DXVK update.
     
  10. MerolaC

    MerolaC Ancient Guru

    Messages:
    4,370
    Likes Received:
    1,082
    GPU:
    AsRock RX 6700XT

  11. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,011
    Likes Received:
    7,351
    GPU:
    GTX 1080ti
    Just a heads up, if you're using DXVK with Guildwars 2 and want to use it with the D3D11 renderer, you need to delete the D3D9 file from the /bin64/ folder as it prevents the game seeing the D3D11 and DXGI files in the main game folder. (i have no idea why theres a dll search location difference between 9 and 11 in that game)
     
  12. SpajdrEX

    SpajdrEX Ancient Guru

    Messages:
    3,399
    Likes Received:
    1,653
    GPU:
    Gainward RTX 4070
    This doesn't just happen with this game, I had a similar problem with AC Origins :)
     
  13. SpajdrEX

    SpajdrEX Ancient Guru

    Messages:
    3,399
    Likes Received:
    1,653
    GPU:
    Gainward RTX 4070
    From there you can get an automatically generated build whenever something new is added:
    https://haagch.frickel.club/files/dxvk/
     
    Deleted member 282649 likes this.
  14. There's also artifacts: https://github.com/doitsujin/dxvk/actions/workflows/artifacts.yml

    I believe you have to be logged into GitHub to see and download artifacts. You click one from whatever branch you want, scroll down to the bottom, and in DXVK's case, find something that's about 23MB and looks like dxvk-master-e81094533b02b542c609a56466a68ab92a006ff9. It'll download an archive with the expected DXVK dlls and setup_dxvk.sh.

    I haven't thought about doing this with DXVK, but I do it regularly with VKD3D-Proton.

    Good to know, thanks! I usually just drop either d3d9.dll or dxgi.dll and d3d11.dll into game folders
     
  15. SpajdrEX

    SpajdrEX Ancient Guru

    Messages:
    3,399
    Likes Received:
    1,653
    GPU:
    Gainward RTX 4070
    Version 1.10.2
    This is the last planned release before several new Vulkan extensions will be required, most notably VK_KHR_dynamic_rendering. See the updated Driver support page for details.

    Bug fixes and Improvements

    • Implemented non-seamless cube maps for D3D9 using the VK_EXT_non_seamless_cube_map extension if supported by the driver
    • FIxed an issue with current versions of the Nvidia Vulkan developer driver not using its on-disk shader cache with DXVK
    • Fixed an issue which would cause the state cache file to not be written properly
    • Fixed an issue where incorrect barriers would be emitted for UAV rendering (#2696)
    • Fixed an issue where the d3d11.samplerAnisotropy option would apply to the wrong kind of samplers
    • Fixed potential issues when using state caches that were created on a driver with a different feature set
    • Fixed broken stencil resolves in D3D9
    • Fixed build issues on GCC 12.1
    • Optimized UAV clears in D3D11 to allow drivers to use image compression more frequently
    • Optimized performance of in-memory compression for SPIR-V shader code
    • Beyond Good and Evil: Work around missing light shafts (#2680)
    • Day Z: Enabled d3d11.cachedDynamicResources option to work around performance issues (PR #2709)
    • Dead Space: Fixed shadow rendering and added 60 FPS lock to work around game bugs (#2704)
    • Dirt Rally: Fixed potential GPU hang due to game bugs in a shader
    • Godfather: Fixed crash on systems that don't support 16x MSAA (#2590)
    • Limbo: Enable 60 FPS limit to work around game bugs (PR #2566)
    • Majesty 2: Work around game bugs causing issues on integrated GPUs and systems with more than 2GB of VRAM (#1542, #PR 2612)
    • Myst V: Work around an issue when the word "Radeon" is not part of the device name on AMD GPUs (#2661)
    • Onechanbara Z2: Chaos: Fixed particle effects and UI elements not displaying properly (#2701)
    • Planetary Annihilation: TITANS: Fixed crash when creating swap chain on a NULL window (PR #2665), as well as a crash due to creating too many internal worker threads (#2670).
    • Plants vs. Zombies Garden Warfare 2: Work around crash when the game detects an AMD GPU (PR #2700)
    • Return of Reckoning: Work around launcher issues (#2568, PR #2579)
    • Scrapland Remastered: Work around black screen issues (#2398, PR #2574)
    • Small Radios Big Televisions: Work around black screen issue (PR #2646)
    • Sonic Adventure 2: Fixed missing particle effects (#2672, PR #2677)
    • SpellForce Platinum Edition: Fixed crash (#2710, PR #2711)
    • Supreme Commander: Fixed missing particle effects (#2638, PR #2682, PR #2684)
    • Star Wars: The Force Unleashed II: Fixed some particle effects not rencering correctly (PR #2584)
    • Star Wars: The Old Republic: Fixed rendering issues (#2676, PR #2681)
    https://github.com/doitsujin/dxvk/releases/tag/v1.10.2
     
    Cryio and OnnA like this.

  16. OnnA

    OnnA Ancient Guru

    Messages:
    17,846
    Likes Received:
    6,739
    GPU:
    TiTan RTX Ampere UV
    BlindBison and Cryio like this.
  17. SpajdrEX

    SpajdrEX Ancient Guru

    Messages:
    3,399
    Likes Received:
    1,653
    GPU:
    Gainward RTX 4070
    VERSION 2.0

    Driver compatibility

    A Vulkan 1.3 capable driver and wine version are required to run this version of DXVK. See the driver support page for details.

    Many features in this release, especially the shader compilation changes detailed below, require the use of modern Vulkan features, such as Dynamic Rendering, Extended Dynamic State, and Null Descriptors.
    Due to the significant changes required to make use of them, it was no longer practical to maintain and test code paths for older drivers which do not support these features.

    In practice, any system capable of running D3D11 and D3D12 games using Proton Experimental right now will be able to run DXVK 2.0.

    Note: Third-party Vulkan layers that were not updated for Vulkan 1.3 will no longer work.

    D3D9 changes
    Memory management improvements

    In order to reduce the likelihood of running out of address space in 32-bit D3D9 games, DXVK will now use memory-mapped files to store shadow copies of textures.
    This allows us to unmap memory that is not being used by the game, thus freeing up significant amounts of address space, up to several hundred Megabytes. See PR #2663 for implementation details.

    Note: This change does not affect 64-bit games since address space is not a concern there. It also does not affect D3D10 or D3D11 since resource uploads work differently in those APIs and are much more memory efficient.

    Render target feedback loops
    On drivers which support VK_EXT_attachment_feedback_loop_layout, reading from an active render target in D3D9 games is now properly supported, which previously caused rendering artifacts on newer AMD hardware and required driver-level workarounds.
    This affects a number of games, including GTA IV.

    Alpha test improvements
    The D3D9 alpha test implementation was changed to more closely match the behaviour of Nvidia's implementation, which fixes inaccuracies in various games. The d3d9.alphaTestWiggleRoom option was removed, and games that previously required this option should now work correctly by default.

    D3D10 changes
    DXVK previously shipped incomplete implementations of d3d10.dll and d3d10_1.dll, but has not installed them by default since Version 1.6 since wine's implementation provides more features that are needed for D3D10 games to run, including the D3D10 Effects framework.

    Since our implementation is incomplete and has not been used by Proton or Lutris for a very long time, DXVK will no longer ship these DLLs starting with this release. The D3D10 API itself is still supported via d3d10core.dll.

    D3D11 changes
    Feature support

    DXVK now exposes D3D11 Feaure Level 12_1 with the following newly added features:

    • Tiled Resources up to Tier 3, provided that the corresponding Vulkan sparse binding and sparse residency features are supported
    • Conservative Rasterization up to Tier 3, provided that the corresponding Vulkan conservative rasterization features are supported.
    • Rasterizer Ordered Views, provided that the corresponding Vulkan fragment shader interlock features are supported.
    While no games are known to use these features directly in D3D11, some games and game launchers rely on feature support being consistent between D3D11 and D3D12 in order to allow users to enable D3D12 in the game options.
    While our implementation of these features is generally functional, there may be bugs or performance issues in case a game does use them.

    Furthermore, DXVK now supports the D3D11_FEATURE_SHADER_CACHE and D3D11_FEATURE_D3D11_OPTIONS5 feature queries.

    Note: AMD Vulkan drivers do currently not support fragment shader interlock and are limited to feature level 12_0.

    Note: Intel's ANV driver currently does not support the corresponding Vulkan features and is therefore limited to feature level 11_1. This applies to both DXVK and vkd3d-proton.

    Device contexts
    The implementations of ID3D11DeviceContext were refactored so that immediate contexts and deferred contexts no longer use common entry points.
    This is closer to Windows behaviour and may improve compatibility to third-party libraries and mods that hook into the D3D11 immediate context specifically, and reduces CPU overhead since some frequently used code paths are now more specialized for each context type.

    State clear and restore methods were optimized to further reduce CPU overhead in games that heavily use deferred contexts, e.g. Assassin's Creed: Origins, or explicitly call ClearState frequently, e.g. God of War.

    Shader compilation changes
    On drivers which support VK_EXT_graphics_pipeline_library, including the IndependentInterpolationDecoration feature, Vulkan shaders will now be compiled at the time the game loads its D3D shaders, rather than at draw time. This reduces or eliminates shader compile stutter in many games.

    In games that load their shaders while loading screens or in the menu, this can lead to prolonged periods of very high CPU utilization, especially on weaker CPUs.
    For affected games it is recommended to wait for shader compilation to finish before starting the game to avoid stutter and low performance. Shader compiler activity can be monitored with DXVK_HUD=compiler.

    Note: The relevant Vulkan features are currently only supported by Nvidia drivers (version 520.56.06 or later). Driver support is expected to improve in the future.

    State cache interactions
    This feature largely replaces the state cache. If the given Vulkan features are supported, only pipelines that cannot use the pipeline library feature (e.g. pipelines using tessellation shaders) will be written to and read from the state cache,
    so newly created state cache files will typically only contain a few dozen to a few hundred pipelines, as opposed to thousands or tens of thousands. If the graphics pipeline library feature is not supported, the state cache will be used the same way as it was in older DXVK versions.

    Note: State cache files created with DXVK versions prior to 1.4.3 can no longer be used.

    Note: Despite our efforts, due to the significant changes under the hood, there may be issues when using an older state cache file under some circumstances. If you experience crashes, please test if the game runs with a clean cache file (DXVK_STATE_CACHE=reset) before reporting a bug.

    Caveats
    • Games which only load their D3D shaders at draw time (e.g. Witcher 3, most Unreal Engine games) will still exhibit some stutter, although it should still be less severe than without this feature.
    • For 32-bit games, the implementation tries to aggressively free Vulkan pipelines in order to save memory. This may cause a stutter if the driver's on-disk shader cache is not working properly.
    • On Nvidia drivers, the on-disk shader cache will be significantly larger than with previous versions of DXVK.
      It may be necessary to bypass the size limit by setting the environment variable __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1, or setting a new limit manually via __GL_SHADER_DISK_CACHE_SIZE (in bytes).
    Linux build support
    Work from dxvk-native has been upstreamed in order to facilitate native Linux builds of DXVK, which can be used as a drop-in replacement to port D3D applications without having to change rendering code.

    Note: When porting a D3D11 application, please refer to the Feature support and Performance Guidelines pages on the Wiki to avoid hitting unsupported or slow code paths in DXVK.

    Repository changes
    As part of cleaning up the repository, test applications that were of limited usefulness, as well as our custom d3dcompiler frontends, have been moved to the new dxvk-tests repository.

    Vulkan and SPIR-V headers are now pulled in as submodules from the original repositories. This changes how the repository needs to be cloned and updated, or otherwise building DXVK will fail:

    git clone --recursive https://github.com/…git

    # Run the following command to make git pull
    # Automatically pull in submodule updates
    cd dxvk
    git config submodule.recurse true
    The project wiki was also updated and expanded to be more useful.

    Bug fixes and Improvements
    • Improved behaviour of DXGI waitable swap chains.
    • Improved implementation of DXGI frame statistics.
      Note: The implementation is still not accurate, especially in scenarios with multiple displays or if variable refresh rate is used.
    • Removed limitations on how many resources can be bound at the same time.
    • Removed several workarounds for specific Vulkan drivers or driver versions. This is primarily relevant for Steam's shader pre-caching, as the generated shader code no longer diverges as much depending on the driver version and supported feature set.
    • D3D11 shaders now use the Vulkan memory model in order to more accurately implement UAV coherency rules in compute shaders.
    • Fixed various issuses with the D3D11.3 WriteToSubresource and ReadFromSubresource methods.
    • Fixed various float emulation issues in D3D9 applications.
    • Fixed seamless cube map filtering in D3D9 applications (PR #2889).
    • Fixed issues when rendering to DXGI_FORMAT_A8_UNORM (D3D11) or D3DFMT_A8 (D3D9) render targets with blending enabled.
    • Fixed a bug with dual-source blending when multiple render targets are bound, which could lead to unpredictable results. This affects Elex 2 and potentially other games.
    • Fixed memory allocation logic on Intel integrated graphics.
    • Changed behaviour of the DXVK_STATE_CACHE environment variable, see the README for details.
    • Changed the DXVK_PERF_EVENTS environment variable to DXVK_DEBUG, see the README for details.
    • Alan Wake: Fixed a regression that caused grey rectangles to appear on screen on AMD GPUs. (#2834, PR: #2835)
    • Alice Madness Returns: Fixed an issue with flashing bright spots. (PR: #2939)
    • Anomaly: Warzone Earth: Fixed a deadlock when starting the game. (#1650, PR: #3035)
    • Beyond Good and Evil: Enabled 60 FPS limit to work around game bugs. (PR #2828)
    • Dragon Age Origins: Work around an out of memory issue when alt tabbing out of the game. (#3022, PR: #3023)
    • Empire: Total War: Fixed rendering. (#3017, PR #3018)
    • Final Fantasy XV: Improved performance when VXAO is enabled.
    • Grand Theft Auto IV: Disabled support for DF texture formats to make the game render mirrors in higher quality.
    • Heroes Of Annihilated Empires: Fixed crash. (#2879)
    • Limit King of Fighters XIII: Enabled 60 FPS limit to work around game bugs. (#2647, PR #2831)
    • Metal Gear Solid V: Ground Zeroes: Work around texture streaming issues on GPUs with 4 GiB or more VRAM. (PR #2867)
    • SiN Episodes: Emergence: Work around an out-of-memory issue caused by the game creating an infinite number of textures. (PR #2907)
    • Sonic Generations: Improved performance by reducing GPU synchronization. (PR: #3009)
    • Spider Man: Shattered Dimensions: Fixed a lighting issue. (#2780, PR: #2782)
    • The Ship: Work around an out-of-memory issue caused by the game creating an infinite number of textures. (#2893, PR #2896)
    • Warhammer Online: Enabled 100 FPS limit on 64-bit executable to work around game bugs. (PR #2902)
    • Ys Seven: Fixed a regression that caused the game to only render a black screen. (PR: #2873)
    Special thanks to @Blisto91 for doing a significant amount of testing during development.

    https://github.com/doitsujin/dxvk/releases/tag/v2.0
     
    Cryio, rflair, Mufflore and 4 others like this.
  18. BlindBison

    BlindBison Ancient Guru

    Messages:
    2,414
    Likes Received:
    1,139
    GPU:
    RTX 3070
    Wow, that's awesome -- great work!

    Does anyone know if these changes will be implemented for the DXVK_Async build? (Apologies if it doesn't work that way, I'm rather new to DXVK). Thanks,
     
  19. Mufflore

    Mufflore Ancient Guru

    Messages:
    14,691
    Likes Received:
    2,671
    GPU:
    Aorus 3090 Xtreme
    Great!!
     
  20. Astyanax

    Astyanax Ancient Guru

    Messages:
    17,011
    Likes Received:
    7,351
    GPU:
    GTX 1080ti
    Note: there is no current support for this in any AMDVLK, which means also no windows support.
     
    Last edited: Nov 13, 2022
    Cryio likes this.

Share This Page