2017-10-11 03:09:04 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "dxgi_adapter.h"
|
2019-03-14 15:28:05 +01:00
|
|
|
#include "dxgi_monitor.h"
|
2018-08-07 14:47:06 +02:00
|
|
|
#include "dxgi_options.h"
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2018-11-02 14:37:59 +01:00
|
|
|
#include "../dxvk/dxvk_instance.h"
|
|
|
|
|
2017-10-11 03:09:04 +02:00
|
|
|
namespace dxvk {
|
|
|
|
|
2020-10-24 17:41:55 +02:00
|
|
|
class DxgiFactory : public DxgiObject<IDXGIFactory7> {
|
2017-10-11 03:09:04 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2018-10-11 09:56:30 +02:00
|
|
|
DxgiFactory(UINT Flags);
|
2017-10-11 03:09:04 +02:00
|
|
|
~DxgiFactory();
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE QueryInterface(
|
2018-04-14 12:02:55 +02:00
|
|
|
REFIID riid,
|
|
|
|
void** ppvObject) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE GetParent(
|
2018-04-14 12:02:55 +02:00
|
|
|
REFIID riid,
|
|
|
|
void** ppParent) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2018-05-22 23:52:03 +02:00
|
|
|
BOOL STDMETHODCALLTYPE IsWindowedStereoEnabled() final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE CreateSoftwareAdapter(
|
2018-04-14 12:02:55 +02:00
|
|
|
HMODULE Module,
|
|
|
|
IDXGIAdapter** ppAdapter) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE CreateSwapChain(
|
2017-10-11 03:09:04 +02:00
|
|
|
IUnknown* pDevice,
|
|
|
|
DXGI_SWAP_CHAIN_DESC* pDesc,
|
|
|
|
IDXGISwapChain** ppSwapChain) final;
|
|
|
|
|
2018-05-22 23:52:03 +02:00
|
|
|
HRESULT STDMETHODCALLTYPE CreateSwapChainForHwnd(
|
|
|
|
IUnknown* pDevice,
|
|
|
|
HWND hWnd,
|
|
|
|
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
|
|
|
const DXGI_SWAP_CHAIN_FULLSCREEN_DESC* pFullscreenDesc,
|
|
|
|
IDXGIOutput* pRestrictToOutput,
|
|
|
|
IDXGISwapChain1** ppSwapChain) final;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE CreateSwapChainForCoreWindow(
|
|
|
|
IUnknown* pDevice,
|
|
|
|
IUnknown* pWindow,
|
|
|
|
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
|
|
|
IDXGIOutput* pRestrictToOutput,
|
|
|
|
IDXGISwapChain1** ppSwapChain) final;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE CreateSwapChainForComposition(
|
|
|
|
IUnknown* pDevice,
|
|
|
|
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
|
|
|
IDXGIOutput* pRestrictToOutput,
|
|
|
|
IDXGISwapChain1** ppSwapChain) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE EnumAdapters(
|
2018-04-14 12:02:55 +02:00
|
|
|
UINT Adapter,
|
|
|
|
IDXGIAdapter** ppAdapter) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE EnumAdapters1(
|
2018-04-14 12:02:55 +02:00
|
|
|
UINT Adapter,
|
|
|
|
IDXGIAdapter1** ppAdapter) final;
|
2017-11-26 16:12:11 +01:00
|
|
|
|
2018-10-11 10:58:26 +02:00
|
|
|
HRESULT STDMETHODCALLTYPE EnumAdapterByLuid(
|
|
|
|
LUID AdapterLuid,
|
|
|
|
REFIID riid,
|
|
|
|
void** ppvAdapter) final;
|
|
|
|
|
2020-10-23 12:15:19 +02:00
|
|
|
HRESULT STDMETHODCALLTYPE EnumAdapterByGpuPreference(
|
|
|
|
UINT Adapter,
|
|
|
|
DXGI_GPU_PREFERENCE GpuPreference,
|
|
|
|
REFIID riid,
|
|
|
|
void** ppvAdapter);
|
|
|
|
|
2018-10-11 10:58:26 +02:00
|
|
|
HRESULT STDMETHODCALLTYPE EnumWarpAdapter(
|
|
|
|
REFIID riid,
|
|
|
|
void** ppvAdapter) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE GetWindowAssociation(
|
2018-04-14 12:02:55 +02:00
|
|
|
HWND* pWindowHandle) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2018-05-22 23:52:03 +02:00
|
|
|
HRESULT STDMETHODCALLTYPE GetSharedResourceAdapterLuid(
|
|
|
|
HANDLE hResource,
|
|
|
|
LUID* pLuid) final;
|
|
|
|
|
2017-12-12 12:50:52 +01:00
|
|
|
HRESULT STDMETHODCALLTYPE MakeWindowAssociation(
|
2018-04-14 12:02:55 +02:00
|
|
|
HWND WindowHandle,
|
|
|
|
UINT Flags) final;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
2018-05-22 23:52:03 +02:00
|
|
|
BOOL STDMETHODCALLTYPE IsCurrent() final;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE RegisterOcclusionStatusWindow(
|
|
|
|
HWND WindowHandle,
|
|
|
|
UINT wMsg,
|
|
|
|
DWORD* pdwCookie) final;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE RegisterStereoStatusEvent(
|
|
|
|
HANDLE hEvent,
|
|
|
|
DWORD* pdwCookie) final;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE RegisterStereoStatusWindow(
|
|
|
|
HWND WindowHandle,
|
|
|
|
UINT wMsg,
|
|
|
|
DWORD* pdwCookie) final;
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE RegisterOcclusionStatusEvent(
|
|
|
|
HANDLE hEvent,
|
|
|
|
DWORD* pdwCookie) final;
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE UnregisterStereoStatus(
|
|
|
|
DWORD dwCookie) final;
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE UnregisterOcclusionStatus(
|
|
|
|
DWORD dwCookie) final;
|
2017-11-26 16:12:11 +01:00
|
|
|
|
2018-10-11 09:56:30 +02:00
|
|
|
UINT STDMETHODCALLTYPE GetCreationFlags() final;
|
2019-09-19 16:38:01 +02:00
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE CheckFeatureSupport(
|
|
|
|
DXGI_FEATURE Feature,
|
|
|
|
void* pFeatureSupportData,
|
|
|
|
UINT FeatureSupportDataSize) final;
|
|
|
|
|
2020-10-23 12:21:02 +02:00
|
|
|
HRESULT STDMETHODCALLTYPE RegisterAdaptersChangedEvent(
|
|
|
|
HANDLE hEvent,
|
|
|
|
DWORD* pdwCookie);
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE UnregisterAdaptersChangedEvent(
|
|
|
|
DWORD Cookie);
|
|
|
|
|
2019-11-08 11:06:15 +01:00
|
|
|
Rc<DxvkInstance> GetDXVKInstance() const {
|
|
|
|
return m_instance;
|
|
|
|
}
|
|
|
|
|
2018-08-07 14:47:06 +02:00
|
|
|
const DxgiOptions* GetOptions() const {
|
|
|
|
return &m_options;
|
|
|
|
}
|
2019-03-14 15:35:35 +01:00
|
|
|
|
|
|
|
DxgiMonitorInfo* GetMonitorInfo() {
|
|
|
|
return &m_monitorInfo;
|
|
|
|
}
|
2018-08-07 14:47:06 +02:00
|
|
|
|
2017-10-11 03:09:04 +02:00
|
|
|
private:
|
|
|
|
|
2018-06-26 12:33:26 +02:00
|
|
|
Rc<DxvkInstance> m_instance;
|
2019-03-14 15:28:05 +01:00
|
|
|
DxgiMonitorInfo m_monitorInfo;
|
2018-08-07 14:47:06 +02:00
|
|
|
DxgiOptions m_options;
|
2018-10-11 09:56:30 +02:00
|
|
|
UINT m_flags;
|
2017-10-11 03:09:04 +02:00
|
|
|
|
|
|
|
HWND m_associatedWindow = nullptr;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|