Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions build-arm64ec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 7 additions & 0 deletions src/d3d11/d3d11_swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -242,6 +243,7 @@ class MTLD3D11SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return factory_->QueryInterface(riid, parent);
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
Present(UINT sync_interval, UINT flags) final {
Expand All @@ -259,6 +261,7 @@ class MTLD3D11SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
}
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
SetFullscreenState(BOOL Fullscreen, IDXGIOutput *pTarget) final {
Expand Down Expand Up @@ -472,6 +475,7 @@ class MTLD3D11SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return S_OK;
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
ResizeBuffers(UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT Format,
Expand Down Expand Up @@ -534,6 +538,7 @@ class MTLD3D11SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return S_OK;
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
ResizeTarget(const DXGI_MODE_DESC *pDesc) final {
Expand Down Expand Up @@ -727,6 +732,7 @@ class MTLD3D11SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return SyncFrameState();
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
Present1(UINT SyncInterval, UINT PresentFlags,
Expand Down Expand Up @@ -1012,6 +1018,7 @@ class MTLD3D11SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return 0;
}

DXMT_HOTPATCHABLE
HRESULT STDMETHODCALLTYPE ResizeBuffers1(UINT BufferCount, UINT Width, UINT Height,
DXGI_FORMAT Format, UINT SwapChainFlags,
const UINT *pCreationNodeMask,
Expand Down
7 changes: 7 additions & 0 deletions src/d3d12/d3d12_swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "com/com_pointer.hpp"
#include "log/log.hpp"
#include "wsi_window.hpp"
#include "util_hotpatch.h"
#include "config/config.hpp"
#include <cfloat>

Expand Down Expand Up @@ -261,6 +262,7 @@ class MTLD3D12SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return factory_->QueryInterface(riid, parent);
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
Present(UINT sync_interval, UINT flags) final {
Expand All @@ -275,6 +277,7 @@ class MTLD3D12SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return backbuffers_[Buffer]->QueryInterface(riid, ppSurface);
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
SetFullscreenState(BOOL Fullscreen, IDXGIOutput *pTarget) final {
Expand Down Expand Up @@ -486,6 +489,7 @@ class MTLD3D12SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return S_OK;
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
ResizeBuffers(UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT Format, UINT flags) final {
Expand Down Expand Up @@ -535,6 +539,7 @@ class MTLD3D12SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return S_OK;
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
ResizeTarget(const DXGI_MODE_DESC *pDesc) final {
Expand Down Expand Up @@ -694,6 +699,7 @@ class MTLD3D12SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return E_NOTIMPL;
};

DXMT_HOTPATCHABLE
HRESULT
STDMETHODCALLTYPE
Present1(UINT SyncInterval, UINT PresentFlags, const DXGI_PRESENT_PARAMETERS *pPresentParameters) final {
Expand Down Expand Up @@ -825,6 +831,7 @@ class MTLD3D12SwapChain final : public MTLDXGISubObject<IDXGISwapChain4, MTLD3D1
return presentation_count_ % backbuffers_.size();
}

DXMT_HOTPATCHABLE
HRESULT STDMETHODCALLTYPE
ResizeBuffers1(
UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT Format, UINT SwapChainFlags, const UINT *pCreationNodeMask,
Expand Down
5 changes: 5 additions & 0 deletions src/dxgi/dxgi_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "dxgi_object.hpp"
#include "com/com_guid.hpp"
#include "log/log.hpp"
#include "util_hotpatch.h"
#include "util_string.hpp"
#include "wsi_window.hpp"
#include "Metal.hpp"
Expand Down Expand Up @@ -64,6 +65,7 @@ class MTLDXGIFactory : public MTLDXGIObject<IDXGIFactory6> {
return DXGI_ERROR_UNSUPPORTED;
}

DXMT_HOTPATCHABLE
HRESULT STDMETHODCALLTYPE
CreateSwapChain(IUnknown *pDevice, DXGI_SWAP_CHAIN_DESC *pDesc,
IDXGISwapChain **ppSwapChain) final {
Expand Down Expand Up @@ -97,6 +99,7 @@ class MTLDXGIFactory : public MTLDXGIObject<IDXGIFactory6> {
return hr;
}

DXMT_HOTPATCHABLE
HRESULT STDMETHODCALLTYPE CreateSwapChainForHwnd(
IUnknown *pDevice, HWND hWnd, const DXGI_SWAP_CHAIN_DESC1 *pDesc,
const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc,
Expand Down Expand Up @@ -135,6 +138,7 @@ class MTLDXGIFactory : public MTLDXGIObject<IDXGIFactory6> {
ppSwapChain);
}

DXMT_HOTPATCHABLE
HRESULT STDMETHODCALLTYPE CreateSwapChainForCoreWindow(
IUnknown *pDevice, IUnknown *pWindow, const DXGI_SWAP_CHAIN_DESC1 *pDesc,
IDXGIOutput *pRestrictToOutput, IDXGISwapChain1 **ppSwapChain) final {
Expand All @@ -144,6 +148,7 @@ class MTLDXGIFactory : public MTLDXGIObject<IDXGIFactory6> {
return E_NOTIMPL;
}

DXMT_HOTPATCHABLE
HRESULT STDMETHODCALLTYPE CreateSwapChainForComposition(
IUnknown *pDevice, const DXGI_SWAP_CHAIN_DESC1 *pDesc,
IDXGIOutput *pRestrictToOutput, IDXGISwapChain1 **ppSwapChain) final {
Expand Down
17 changes: 17 additions & 0 deletions src/util/util_hotpatch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Derived from DXVK (originally under zlib License)
*
* See
* <https://github.com/doitsujin/dxvk/blob/8c4fd2723c031b425fb857454e9e5fa4ca25f4ac/src/util/util_hotpatch.h>
* See <https://github.com/doitsujin/dxvk/blob/master/LICENSE>
*/

#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
1 change: 1 addition & 0 deletions tests/dx11/stb_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading