|
HydraHook
Direct3D and Core Audio hooking library for Windows
|
Direct3D 12 hook callbacks. More...
Go to the source code of this file.
Classes | |
| struct | PHYDRAHOOK_D3D12_EVENT_CALLBACKS |
| Direct3D 12 event callback collection. More... | |
Typedefs | |
| typedef VOID | EVT_HYDRAHOOK_D3D12_PRE_PRESENT(IDXGISwapChain *pSwapChain, UINT SyncInterval, UINT Flags, PHYDRAHOOK_EVT_PRE_EXTENSION Extension) |
| Pre-Present callback; receives extension with engine handle. | |
| typedef EVT_HYDRAHOOK_D3D12_PRE_PRESENT * | PFN_HYDRAHOOK_D3D12_PRE_PRESENT |
| typedef VOID | EVT_HYDRAHOOK_D3D12_POST_PRESENT(IDXGISwapChain *pSwapChain, UINT SyncInterval, UINT Flags, PHYDRAHOOK_EVT_POST_EXTENSION Extension) |
| Post-Present callback; receives extension with engine handle. | |
| typedef EVT_HYDRAHOOK_D3D12_POST_PRESENT * | PFN_HYDRAHOOK_D3D12_POST_PRESENT |
| typedef VOID | EVT_HYDRAHOOK_D3D12_PRE_RESIZE_TARGET(IDXGISwapChain *pSwapChain, const DXGI_MODE_DESC *pNewTargetParameters, PHYDRAHOOK_EVT_PRE_EXTENSION Extension) |
| Pre-ResizeTarget callback. | |
| typedef EVT_HYDRAHOOK_D3D12_PRE_RESIZE_TARGET * | PFN_HYDRAHOOK_D3D12_PRE_RESIZE_TARGET |
| typedef VOID | EVT_HYDRAHOOK_D3D12_POST_RESIZE_TARGET(IDXGISwapChain *pSwapChain, const DXGI_MODE_DESC *pNewTargetParameters, PHYDRAHOOK_EVT_POST_EXTENSION Extension) |
| Post-ResizeTarget callback. | |
| typedef EVT_HYDRAHOOK_D3D12_POST_RESIZE_TARGET * | PFN_HYDRAHOOK_D3D12_POST_RESIZE_TARGET |
| typedef VOID | EVT_HYDRAHOOK_D3D12_PRE_RESIZE_BUFFERS(IDXGISwapChain *pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags, PHYDRAHOOK_EVT_PRE_EXTENSION Extension) |
| Pre-ResizeBuffers callback. | |
| typedef EVT_HYDRAHOOK_D3D12_PRE_RESIZE_BUFFERS * | PFN_HYDRAHOOK_D3D12_PRE_RESIZE_BUFFERS |
| typedef VOID | EVT_HYDRAHOOK_D3D12_POST_RESIZE_BUFFERS(IDXGISwapChain *pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags, PHYDRAHOOK_EVT_POST_EXTENSION Extension) |
| Post-ResizeBuffers callback. | |
| typedef EVT_HYDRAHOOK_D3D12_POST_RESIZE_BUFFERS * | PFN_HYDRAHOOK_D3D12_POST_RESIZE_BUFFERS |
Functions | |
| HRESULT | D3D12_DEVICE_FROM_SWAPCHAIN (IDXGISwapChain *pSwapChain, ID3D12Device **ppDevice) |
| HRESULT | D3D12_BACKBUFFER_FROM_SWAPCHAIN (IDXGISwapChain *pSwapChain, ID3D12Resource **ppBackBuffer, UINT uBuffer=0) |
| Retrieves back buffer resource from swap chain. | |
| VOID | HYDRAHOOK_D3D12_EVENT_CALLBACKS_INIT (_Out_ PHYDRAHOOK_D3D12_EVENT_CALLBACKS Callbacks) |
| VOID | HydraHookEngineSetD3D12EventCallbacks (_In_ PHYDRAHOOK_ENGINE Engine, _In_ PHYDRAHOOK_D3D12_EVENT_CALLBACKS Callbacks) |
| Registers Direct3D 12 render pipeline callbacks. | |
| ID3D12CommandQueue * | HydraHookEngineGetD3D12CommandQueue (_In_ IDXGISwapChain *pSwapChain) |
| Returns the D3D12 command queue for a swap chain (for overlay rendering). Exact associations are recorded at creation and refreshed after successful ResizeBuffers1. On supported x64 DXGI builds, a late lookup can resolve the current back buffer's queue. ResizeBuffers1 can assign different queues to different buffers. Resolve the queue in the pre-present callback before submitting work for that buffer. When no exact association is available, the ExecuteCommandLists fallback is device-scoped and does not establish swap-chain ownership. | |
| ID3D12CommandQueue * | HydraHookEngineGetVerifiedD3D12CommandQueue (_In_ IDXGISwapChain *pSwapChain) |
| Returns the verified direct queue for the current D3D12 back buffer. | |
| BOOL | HydraHookEngineDeferD3D12Resize (_In_ PHYDRAHOOK_EVT_PRE_EXTENSION Extension) |
| Defers the active D3D12 ResizeBuffers or ResizeBuffers1 call. | |
Direct3D 12 hook callbacks.
Defines event callbacks for Present, ResizeTarget, and ResizeBuffers with HYDRAHOOK_EVT_PRE_EXTENSION / HYDRAHOOK_EVT_POST_EXTENSION for engine access.
D3D10, D3D11, and D3D12 share unified DXGI swap-chain hooks (Present/Present1, ResizeTarget, ResizeBuffers/ResizeBuffers1) that dispatch per call to the callback table matching the swap chain's enabled device runtime.
Definition in file HydraHookDirect3D12.h.
| typedef VOID EVT_HYDRAHOOK_D3D12_POST_PRESENT(IDXGISwapChain *pSwapChain, UINT SyncInterval, UINT Flags, PHYDRAHOOK_EVT_POST_EXTENSION Extension) |
Post-Present callback; receives extension with engine handle.
Definition at line 67 of file HydraHookDirect3D12.h.
| typedef VOID EVT_HYDRAHOOK_D3D12_POST_RESIZE_BUFFERS(IDXGISwapChain *pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags, PHYDRAHOOK_EVT_POST_EXTENSION Extension) |
Post-ResizeBuffers callback.
Definition at line 120 of file HydraHookDirect3D12.h.
| typedef VOID EVT_HYDRAHOOK_D3D12_POST_RESIZE_TARGET(IDXGISwapChain *pSwapChain, const DXGI_MODE_DESC *pNewTargetParameters, PHYDRAHOOK_EVT_POST_EXTENSION Extension) |
Post-ResizeTarget callback.
Definition at line 92 of file HydraHookDirect3D12.h.
| typedef VOID EVT_HYDRAHOOK_D3D12_PRE_PRESENT(IDXGISwapChain *pSwapChain, UINT SyncInterval, UINT Flags, PHYDRAHOOK_EVT_PRE_EXTENSION Extension) |
Pre-Present callback; receives extension with engine handle.
Definition at line 54 of file HydraHookDirect3D12.h.
| typedef VOID EVT_HYDRAHOOK_D3D12_PRE_RESIZE_BUFFERS(IDXGISwapChain *pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags, PHYDRAHOOK_EVT_PRE_EXTENSION Extension) |
Pre-ResizeBuffers callback.
Definition at line 104 of file HydraHookDirect3D12.h.
| typedef VOID EVT_HYDRAHOOK_D3D12_PRE_RESIZE_TARGET(IDXGISwapChain *pSwapChain, const DXGI_MODE_DESC *pNewTargetParameters, PHYDRAHOOK_EVT_PRE_EXTENSION Extension) |
Pre-ResizeTarget callback.
Definition at line 80 of file HydraHookDirect3D12.h.
Definition at line 74 of file HydraHookDirect3D12.h.
Definition at line 130 of file HydraHookDirect3D12.h.
Definition at line 98 of file HydraHookDirect3D12.h.
Definition at line 61 of file HydraHookDirect3D12.h.
Definition at line 114 of file HydraHookDirect3D12.h.
Definition at line 86 of file HydraHookDirect3D12.h.
|
inline |
Retrieves back buffer resource from swap chain.
| [in] | pSwapChain | Valid swap chain. |
| [out] | ppBackBuffer | Receives ID3D12Resource pointer. |
| [in] | uBuffer | Buffer index (default 0). |
Definition at line 157 of file HydraHookDirect3D12.h.
References D3D12_BACKBUFFER_FROM_SWAPCHAIN().
Referenced by D3D12_BACKBUFFER_FROM_SWAPCHAIN().
|
inline |
Obtain the D3D12 device associated with a swap chain.
| [in] | pSwapChain | Swap chain to query for its device. |
| [out] | ppDevice | Receives the ID3D12Device pointer; the returned interface is AddRef'd on success and must be Release'd by the caller. |
Definition at line 140 of file HydraHookDirect3D12.h.
References D3D12_DEVICE_FROM_SWAPCHAIN().
Referenced by D3D12_DEVICE_FROM_SWAPCHAIN().
|
inline |
Initialize a HYDRAHOOK_D3D12_EVENT_CALLBACKS structure by zeroing its memory.
| [out] | Callbacks | Pointer to the callback structure to initialize; all callback members will be set to NULL. |
Definition at line 187 of file HydraHookDirect3D12.h.
References HYDRAHOOK_D3D12_EVENT_CALLBACKS_INIT().
Referenced by HYDRAHOOK_D3D12_EVENT_CALLBACKS_INIT().
| BOOL HydraHookEngineDeferD3D12Resize | ( | _In_ PHYDRAHOOK_EVT_PRE_EXTENSION | Extension | ) |
Defers the active D3D12 ResizeBuffers or ResizeBuffers1 call.
A deferred call returns DXGI_ERROR_WAS_STILL_DRAWING to the host and does not invoke the post-resize callback. The host can retry once outstanding GPU work drains.
| [in] | Extension | Extension from the active D3D12 pre-resize callback. |
References HYDRAHOOK_API, and HydraHookEngineDeferD3D12Resize().
Referenced by HydraHookEngineDeferD3D12Resize(), and HydraHookEngineDeferD3D12Resize().
| ID3D12CommandQueue * HydraHookEngineGetD3D12CommandQueue | ( | _In_ IDXGISwapChain * | pSwapChain | ) |
Returns the D3D12 command queue for a swap chain (for overlay rendering). Exact associations are recorded at creation and refreshed after successful ResizeBuffers1. On supported x64 DXGI builds, a late lookup can resolve the current back buffer's queue. ResizeBuffers1 can assign different queues to different buffers. Resolve the queue in the pre-present callback before submitting work for that buffer. When no exact association is available, the ExecuteCommandLists fallback is device-scoped and does not establish swap-chain ownership.
| [in] | pSwapChain | The swap chain (e.g. from Present callback). |
References HYDRAHOOK_API, and HydraHookEngineGetD3D12CommandQueue().
Referenced by HydraHookEngineGetD3D12CommandQueue(), and HydraHookEngineGetD3D12CommandQueue().
| ID3D12CommandQueue * HydraHookEngineGetVerifiedD3D12CommandQueue | ( | _In_ IDXGISwapChain * | pSwapChain | ) |
Returns the verified direct queue for the current D3D12 back buffer.
Uses the exact creation or uniform resize association, or the current-buffer lookup on supported DXGI builds. Call in pre-present before submitting work.
| [in] | pSwapChain | The swap chain being presented. |
References HYDRAHOOK_API, and HydraHookEngineGetVerifiedD3D12CommandQueue().
Referenced by HydraHookEngineGetVerifiedD3D12CommandQueue(), and HydraHookEngineGetVerifiedD3D12CommandQueue().
| VOID HydraHookEngineSetD3D12EventCallbacks | ( | _In_ PHYDRAHOOK_ENGINE | Engine, |
| _In_ PHYDRAHOOK_D3D12_EVENT_CALLBACKS | Callbacks ) |
Registers Direct3D 12 render pipeline callbacks.
| [in] | Engine | Valid engine handle. |
| [in] | Callbacks | Callback collection; NULL pointers are ignored. |
References HYDRAHOOK_API, and HydraHookEngineSetD3D12EventCallbacks().
Referenced by HydraHookEngineSetD3D12EventCallbacks(), and HydraHookEngineSetD3D12EventCallbacks().