Skip to content

Add optional Vulkan rendering via DXVK (Settings -> Video) - #5342

Open
iManGaaX wants to merge 13 commits into
multitheftauto:masterfrom
iManGaaX:feature/vulkan-rendering
Open

Add optional Vulkan rendering via DXVK (Settings -> Video)#5342
iManGaaX wants to merge 13 commits into
multitheftauto:masterfrom
iManGaaX:feature/vulkan-rendering

Conversation

@iManGaaX

@iManGaaX iManGaaX commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional "Enable Vulkan" toggle that runs the D3D9 renderer through DXVK; translating every Direct3D 9 draw call into Vulkan before it reaches the GPUs

  • Higher and more stable frame rates, especially in crowded areas where the CPU used to be the bottleneck
  • Better CPU/GPU balance, less work per frame on the main thread, better use of multi-core CPUs and modern drivers
  • Lower CPU driver overhead overall, freeing resources for physics and streaming

The feature is disabled by default. It is engineered so it can never brick the game on unsupported hardware; every failure path (missing/corrupted files, GPU without Vulkan support) silently reverts to native D3D9 and the game boots normally, with the toggle automatically switched off

What's included

1. Settings -> Video

  • New "Enable Vulkan" checkbox placed next to VSync in Video settings
  • Toggling persists immediately to coreconfig.xml (dxvk_enabled)
  • Enabling shows a confirmation dialog explaining the expected frame-rate benefit and the brief shader-cache stutter on first runs, with Yes/No
  • After confirming, the game requests a restart; disabling also requests a restart so D3D9 is restored
  • Pre-enable system checks with clear dialogs:
    • "VULKAN FILES MISSING OR DAMAGED"; staged DLLs absent or invalid
    • "VULKAN NOT SUPPORTED"; GPU/driver can't run Vulkan

2. Loader

  • Vulkan support is probed safely; the staged d3d9.dll is loaded in isolation (LOAD_WITH_ALTERED_SEARCH_PATH) and a Direct3DCreate9 smoke test is executed inside a __try/__except handler; the result is cached via vulkan_supported + file-hash application settings
  • On success the DLLs are copied into the MTA launch directory (the game's boot mirror) so the process picks them up before native D3D9 loads

3. Safe fallback (no dialogs, no crashes)

  • Missing/corrupted files and/or unsupported GPU -> the loader automatically sets dxvk_enabled=0, removes the placed DLLs, and the game boots normally on native D3D9

4. GTA San Andreas folder stays 100% pristine

  • All DXVK copies happen in the MTA launch mirror under ProgramData; the real GTA install folder is never written to

5. Build pipeline

  • utils/dxvk-1.10.3/build-mta.bat:
    • Fast path: if ready-made d3d9.dll/dxgi.dll sit next to it, they're copied straight to Bin/mta/dxvk
    • Source path: otherwise builds DXVK from source with auto-detected tools (meson/ninja/MinGW-w64/glslang); no hardcoded machine paths; common install locations (scoop, winget, chocolatey, msys2, w64devkit, Vulkan SDK, Python envs) are scanned automatically.
    • Wired into the Loader post-build step (premake)

6. Installer

  • Installs d3d9.dll+dxgi.dll into $INSTDIR\MTA\dxvk

7. Video (Before & After)

2026-09-08.04-58-04.mp4

8. Why dxvk-1.10.3 version?

Because it is the most stable release for MTA/GTA and runs without any issues, and it works on most low-spec devices

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

@FileEX FileEX added the enhancement New feature or request label Sep 8, 2026
@Fernando-A-Rocha

Copy link
Copy Markdown
Contributor

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants