From fa561c121edf6208729bf3c65a9f0da72da373df Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 7 Nov 2023 20:50:22 +1100 Subject: [PATCH] [host] dxgi: move and document dxgi_* exposed functions for backends --- .../Windows/capture/DXGI/src/backend.h | 19 ++++++++++++++++--- .../platform/Windows/capture/DXGI/src/d3d12.c | 1 + .../Windows/capture/DXGI/src/dxgi_capture.h | 7 ------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/host/platform/Windows/capture/DXGI/src/backend.h b/host/platform/Windows/capture/DXGI/src/backend.h index 9cab26c6..ba354d8a 100644 --- a/host/platform/Windows/capture/DXGI/src/backend.h +++ b/host/platform/Windows/capture/DXGI/src/backend.h @@ -21,10 +21,11 @@ #ifndef _H_DXGI_BACKEND_ #define _H_DXGI_BACKEND_ -#include "dxgi_capture.h" +#include "common/types.h" +#include "interface/capture.h" -struct DXGIInterface; -struct Texture; +#include +#include struct DXGICopyBackend { @@ -71,4 +72,16 @@ struct DXGICopyBackend void (*preRelease)(void); }; +// these are functions exported by dxgi.c for use by the backends +IDXGIAdapter1 * dxgi_getAdapter(void); +ID3D11Device * dxgi_getDevice(void); +ID3D11DeviceContext * dxgi_getContext(void); + +// lock and unlock the context lock +void dxgi_contextLock(void); +void dxgi_contextUnlock(void); + +/* returns true if dxgi:debug is enabled */ +bool dxgi_debug(void); + #endif diff --git a/host/platform/Windows/capture/DXGI/src/d3d12.c b/host/platform/Windows/capture/DXGI/src/d3d12.c index 152ff4ea..e365185e 100644 --- a/host/platform/Windows/capture/DXGI/src/d3d12.c +++ b/host/platform/Windows/capture/DXGI/src/d3d12.c @@ -21,6 +21,7 @@ #include "com_ref.h" #include +#include #include #include #include "common/time.h" diff --git a/host/platform/Windows/capture/DXGI/src/dxgi_capture.h b/host/platform/Windows/capture/DXGI/src/dxgi_capture.h index 1f4667f8..916a7236 100644 --- a/host/platform/Windows/capture/DXGI/src/dxgi_capture.h +++ b/host/platform/Windows/capture/DXGI/src/dxgi_capture.h @@ -120,11 +120,4 @@ struct DXGIInterface struct FrameDamage frameDamage[LGMP_Q_FRAME_LEN]; }; -IDXGIAdapter1 * dxgi_getAdapter(void); -ID3D11Device * dxgi_getDevice(void); -ID3D11DeviceContext * dxgi_getContext(void); -void dxgi_contextLock(void); -void dxgi_contextUnlock(void); -bool dxgi_debug(void); - #endif