27 Commits
Author SHA1 Message Date
Josh Guyette 66fed525af native: use the Microsoft x64 calling convention on x86_64
The native build defined STDMETHODCALLTYPE, __stdcall and WINAPI as empty,
so on x86_64 macOS every D3D entry point and COM method used the System V
convention. Embedders built against the Windows ABI (virglrenderer's
Neptune backend declares NPT_STDMETHODCALLTYPE as ms_abi on x86_64 macOS,
as d3dmetal-native does) pass arguments in rcx/rdx/r8/r9, so D3D11CreateDevice
read its outputs from the wrong registers and spun on a garbage pointer.

Define them as __attribute__((ms_abi)) on x86_64, make STDMETHOD and the
IUnknown methods carry the convention so overrides match, and leave arm64
unchanged (it has a single convention).

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Josh Guyette <[email protected]>
2026-11-10 10:03:00 -08:00
Marc-Aurel Zent 2c1a15d81b feat(d3d11): implement CreateSharedHandle in MTLD3D11Fence 2025-11-20 16:10:40 +08:00
Alexander Eichner 39a704d793 chore(include): add headers for native build 2025-07-15 16:57:01 +08:00
3Shain f905227174 chore: remove unused headers 2025-04-23 17:30:10 +08:00
3Shain 0e00042cbd refactor: remove metal-cpp dependency
[no ci]
2025-04-23 17:30:10 +08:00
3Shain 753fd5ea13 refactor: adapt to unixcall, part 5 2025-04-23 17:30:10 +08:00
3Shain 532e931103 feat: display scaler info on metal hud 2025-03-02 19:43:28 +08:00
3Shain 85d65e77c0 feat(d3d11): implement IMTLD3D11ContextExt::TemporalUpscale() 2025-03-02 19:43:28 +08:00
3Shain fbd708c8de chore(d3d11): multiply CALayer contentsScale by metalfx scale factor 2025-02-07 13:59:54 +08:00
3Shain f1d53cd925 chore(winemetal): remove unused symbols 2025-02-06 14:53:45 +08:00
3Shain 968ebb9aa1 chore: support gcc 2025-01-15 18:02:46 +08:00
3Shain cb9c5b4911 chore: remove objc block API from metal-cpp
Since gcc can't handle block syntax.
2025-01-15 17:57:30 +08:00
3Shain 3c8f7eeb24 refactor: implement event query via MTLSharedEvent 2025-01-15 17:52:12 +08:00
3Shain 10a6f780ac feat: display dxmt description on metalhud 2024-10-21 20:36:07 +08:00
3Shain 487f5b0d1d feat: pipeline cache (part 1) (#16)
* refactor(d3d11): normalize pipeline creation

* refactor(d3d11): introduce IMTLD3D11PipeineCache

* refactor(d3d11): cache input layout

* refactor(d3d11): unify graphics pipeline description

* refactor(d3d11): always do vertex pulling

since the performance is the same and less restriction, the implementation can be simplified by remove the old vertex descriptor method.

* refactor(d3d11): compare blend state by effective properties only

* feat: set thread QoS

* refactor(d3d11): improved cpu ultilization for shader/pso compilation

* chore: twist qos& thread priority mutation order
2024-09-20 21:19:48 +08:00
3Shain 817be76f5f chore(winemetal): dynamically load metal symbols 2024-08-13 15:39:32 +08:00
3Shain 6c89c1e416 feat(d3d11): try to implement vsync
but it's already broken for many existing games because their developer think the user have only screens of refresh rate at 60hz
2024-07-22 00:23:15 +08:00
3Shain 3cc9337c9c chore: solve the actual performance issue 2024-06-30 20:18:53 +01:00
3Shain fed600dd1a feat(d3d11): implement some random features
- disable ds testing when no dsv is bound
- more view interpretation
- copy tex2d from device to staging
2024-06-25 03:16:40 +01:00
3Shain 20fe5efa8f feat: basic staging texture 2024-06-23 14:17:22 +01:00
3Shain 0b77ff7f81 feat: d3d11 milestone 0 (#6)
we eventually make NieR: Automata work, with some notable missing parts: 1. occlusion query, we report all 0 for now 2. uav counter, which is used occasionally
2024-06-21 01:55:03 +01:00
3Shain 0683d437e1 feat: dxbc to air transpiler (part 1) (#1)
A ton of progress. However it progressed too far that I have to split the work now so that I can verify it works at runtime (currently it works for some demo but that's limited)
2024-04-14 02:26:23 +01:00
3Shain 76060ac12d fix!: make metal header portable 2024-02-29 09:13:44 +00:00
3Shain 306483aed4 refactor!: sync with latest metal-cpp 2024-02-29 09:13:44 +00:00
3Shain b39dd63d5a chore: remove hlslcc 2024-02-26 04:07:28 +00:00
3Shain 3af4d47500 feat(airconv): basic transpilation framework
!NOTE: a lot of hardcoded logics need to be properly handled
2024-02-26 03:26:24 +00:00
3Shain 485aeb2f11 chore: initial commit 2023-11-09 00:56:18 +00:00