From 3b78076228af6f9331f6068ed235aff1f83908e8 Mon Sep 17 00:00:00 2001 From: Feifan He Date: Wed, 26 Aug 2026 19:58:20 +0800 Subject: [PATCH 1/5] build: add `-marm64x` flag to arm64ec build --- build-arm64ec.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build-arm64ec.txt b/build-arm64ec.txt index bc8462f47..e9ac3b47d 100644 --- a/build-arm64ec.txt +++ b/build-arm64ec.txt @@ -8,6 +8,12 @@ windres = 'arm64ec-w64-mingw32-windres' [properties] needs_exe_wrapper = true +[built-in options] +c_args = ['-marm64x'] +cpp_args = ['-marm64x'] +c_link_args = ['-marm64x'] +cpp_link_args = ['-marm64x'] + [host_machine] system = 'windows' cpu_family = 'aarch64' From aa749736293f243cb19b2b4f7aaf4f89a851af7c Mon Sep 17 00:00:00 2001 From: Feifan He Date: Wed, 26 Aug 2026 19:58:58 +0800 Subject: [PATCH 2/5] ci: upgrade llvm-mingw to 20260908 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fff1e3534..9042b1f17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ env: WINE_URL: https://github.com/3Shain/wine/releases/download/v8.16-3shain/wine.tar.gz WINE_ARM64EC_VERSION: wine-11.2 WINE_ARM64EC_URL: https://github.com/3Shain/wine/releases/download/wine-11.2/wine-11.2.tar.gz - LLVM_MINGW_VERSION: "20251216" - LLVM_MINGW_DIR: llvm-mingw-20251216-ucrt-macos-universal + LLVM_MINGW_VERSION: "20260908" + LLVM_MINGW_DIR: llvm-mingw-20260908-ucrt-macos-universal jobs: setup-wine: From 37e0453100d8d301a44678cf218eaac9c58b53d6 Mon Sep 17 00:00:00 2001 From: Feifan He Date: Sun, 13 Sep 2026 17:13:13 +0800 Subject: [PATCH 3/5] chore(util): define `DXMT_HOTPATCHABLE` --- src/util/util_hotpatch.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/util/util_hotpatch.h diff --git a/src/util/util_hotpatch.h b/src/util/util_hotpatch.h new file mode 100644 index 000000000..c81ee7faa --- /dev/null +++ b/src/util/util_hotpatch.h @@ -0,0 +1,17 @@ +/* + * Derived from DXVK (originally under zlib License) + * + * See + * + * See + */ + +#pragma once + +#if defined(DECLSPEC_CHPE_PATCHABLE) +#define DXMT_HOTPATCHABLE DECLSPEC_CHPE_PATCHABLE +#elif defined(__arm64ec__) +#define DXMT_HOTPATCHABLE __attribute__((hybrid_patchable)) +#else +#define DXMT_HOTPATCHABLE +#endif \ No newline at end of file From 20af9fcc94643aa5c4f335c8152e54dbc0f10ba8 Mon Sep 17 00:00:00 2001 From: Feifan He Date: Sun, 13 Sep 2026 17:13:19 +0800 Subject: [PATCH 4/5] fix: make several DXGI COM interface functions patchable So that Steam overlay can hook into them. This is mostly relevant for ARM64EC build. Signed-off-by: Feifan He --- src/d3d11/d3d11_swapchain.cpp | 7 +++++++ src/d3d12/d3d12_swapchain.cpp | 7 +++++++ src/dxgi/dxgi_factory.cpp | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index 5e9404d3f..d1825876c 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -17,6 +17,7 @@ #include "util_env.hpp" #include "util_string.hpp" #include "util_win32_compat.h" +#include "util_hotpatch.h" #include "wsi_monitor.hpp" #include "wsi_platform_win32.hpp" #include "wsi_window.hpp" @@ -242,6 +243,7 @@ class MTLD3D11SwapChain final : public MTLDXGISubObjectQueryInterface(riid, parent); }; + DXMT_HOTPATCHABLE HRESULT STDMETHODCALLTYPE Present(UINT sync_interval, UINT flags) final { @@ -259,6 +261,7 @@ class MTLD3D11SwapChain final : public MTLDXGISubObject @@ -261,6 +262,7 @@ class MTLD3D12SwapChain final : public MTLDXGISubObjectQueryInterface(riid, parent); }; + DXMT_HOTPATCHABLE HRESULT STDMETHODCALLTYPE Present(UINT sync_interval, UINT flags) final { @@ -275,6 +277,7 @@ class MTLD3D12SwapChain final : public MTLDXGISubObjectQueryInterface(riid, ppSurface); }; + DXMT_HOTPATCHABLE HRESULT STDMETHODCALLTYPE SetFullscreenState(BOOL Fullscreen, IDXGIOutput *pTarget) final { @@ -486,6 +489,7 @@ class MTLD3D12SwapChain final : public MTLDXGISubObject { return DXGI_ERROR_UNSUPPORTED; } + DXMT_HOTPATCHABLE HRESULT STDMETHODCALLTYPE CreateSwapChain(IUnknown *pDevice, DXGI_SWAP_CHAIN_DESC *pDesc, IDXGISwapChain **ppSwapChain) final { @@ -97,6 +99,7 @@ class MTLDXGIFactory : public MTLDXGIObject { return hr; } + DXMT_HOTPATCHABLE HRESULT STDMETHODCALLTYPE CreateSwapChainForHwnd( IUnknown *pDevice, HWND hWnd, const DXGI_SWAP_CHAIN_DESC1 *pDesc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc, @@ -135,6 +138,7 @@ class MTLDXGIFactory : public MTLDXGIObject { ppSwapChain); } + DXMT_HOTPATCHABLE HRESULT STDMETHODCALLTYPE CreateSwapChainForCoreWindow( IUnknown *pDevice, IUnknown *pWindow, const DXGI_SWAP_CHAIN_DESC1 *pDesc, IDXGIOutput *pRestrictToOutput, IDXGISwapChain1 **ppSwapChain) final { @@ -144,6 +148,7 @@ class MTLDXGIFactory : public MTLDXGIObject { return E_NOTIMPL; } + DXMT_HOTPATCHABLE HRESULT STDMETHODCALLTYPE CreateSwapChainForComposition( IUnknown *pDevice, const DXGI_SWAP_CHAIN_DESC1 *pDesc, IDXGIOutput *pRestrictToOutput, IDXGISwapChain1 **ppSwapChain) final { From 7c8dee1c2d73415301ceb7d1fa810861cef4cd67 Mon Sep 17 00:00:00 2001 From: Feifan He Date: Wed, 16 Sep 2026 16:18:52 +0800 Subject: [PATCH 5/5] chore(tests): disable SIMD for stb_image.h So it compiles under ARM64 (as a work-around) --- tests/dx11/stb_image.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/dx11/stb_image.h b/tests/dx11/stb_image.h index 8879e981b..f1ce952e6 100644 --- a/tests/dx11/stb_image.h +++ b/tests/dx11/stb_image.h @@ -208,6 +208,7 @@ RECENT REVISION HISTORY: // you have issues compiling it, you can disable it entirely by // defining STBI_NO_SIMD. // +#define STBI_NO_SIMD // =========================================================================== // // HDR image support (disable by defining STBI_NO_HDR)