1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 19:54:19 +01:00

[dxgi] Implement IDXGIFactory4

Do not support WARP adapters for the moment.
This commit is contained in:
Philip Rebohle 2018-10-11 10:58:26 +02:00
parent 0b7e114cb0
commit 171251bc83
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 67 additions and 4 deletions

View File

@ -25,7 +25,8 @@ namespace dxvk {
|| riid == __uuidof(IDXGIFactory)
|| riid == __uuidof(IDXGIFactory1)
|| riid == __uuidof(IDXGIFactory2)
|| riid == __uuidof(IDXGIFactory3)) {
|| riid == __uuidof(IDXGIFactory3)
|| riid == __uuidof(IDXGIFactory4)) {
*ppvObject = ref(this);
return S_OK;
}
@ -195,6 +196,42 @@ namespace dxvk {
}
HRESULT STDMETHODCALLTYPE DxgiFactory::EnumAdapterByLuid(
LUID AdapterLuid,
REFIID riid,
void** ppvAdapter) {
InitReturnPtr(ppvAdapter);
uint32_t adapterId = 0;
while (true) {
Com<IDXGIAdapter> adapter;
HRESULT hr = EnumAdapters(adapterId++, &adapter);
if (FAILED(hr))
return hr;
DXGI_ADAPTER_DESC desc;
adapter->GetDesc(&desc);
if (!std::memcmp(&AdapterLuid, &desc.AdapterLuid, sizeof(LUID)))
return adapter->QueryInterface(riid, ppvAdapter);
}
// This should be unreachable
return DXGI_ERROR_NOT_FOUND;
}
HRESULT STDMETHODCALLTYPE DxgiFactory::EnumWarpAdapter(
REFIID riid,
void** ppvAdapter) {
InitReturnPtr(ppvAdapter);
Logger::err("DxgiFactory::EnumWarpAdapter: Not implemented");
return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE DxgiFactory::GetWindowAssociation(HWND *pWindowHandle) {
if (pWindowHandle == nullptr)
return DXGI_ERROR_INVALID_CALL;

View File

@ -9,7 +9,7 @@
namespace dxvk {
class DxgiFactory : public DxgiObject<IDXGIFactory3> {
class DxgiFactory : public DxgiObject<IDXGIFactory4> {
public:
@ -64,6 +64,15 @@ namespace dxvk {
UINT Adapter,
IDXGIAdapter1** ppAdapter) final;
HRESULT STDMETHODCALLTYPE EnumAdapterByLuid(
LUID AdapterLuid,
REFIID riid,
void** ppvAdapter) final;
HRESULT STDMETHODCALLTYPE EnumWarpAdapter(
REFIID riid,
void** ppvAdapter) final;
HRESULT STDMETHODCALLTYPE GetWindowAssociation(
HWND* pWindowHandle) final;

View File

@ -50,7 +50,8 @@ namespace dxvk {
|| riid == __uuidof(IDXGIOutput)
|| riid == __uuidof(IDXGIOutput1)
|| riid == __uuidof(IDXGIOutput2)
|| riid == __uuidof(IDXGIOutput3)) {
|| riid == __uuidof(IDXGIOutput3)
|| riid == __uuidof(IDXGIOutput4)) {
*ppvObject = ref(this);
return S_OK;
}
@ -444,6 +445,16 @@ namespace dxvk {
}
HRESULT STDMETHODCALLTYPE DxgiOutput::CheckOverlayColorSpaceSupport(
DXGI_FORMAT Format,
DXGI_COLOR_SPACE_TYPE ColorSpace,
IUnknown* pConcernedDevice,
UINT* pFlags) {
Logger::warn("DxgiOutput: CheckOverlayColorSpaceSupport: Stub");
return DXGI_ERROR_UNSUPPORTED;
}
HRESULT DxgiOutput::GetDisplayMode(DXGI_MODE_DESC* pMode, DWORD ModeNum) {
::MONITORINFOEXW monInfo;
monInfo.cbSize = sizeof(monInfo);

View File

@ -34,7 +34,7 @@ namespace dxvk {
};
class DxgiOutput : public DxgiObject<IDXGIOutput3> {
class DxgiOutput : public DxgiObject<IDXGIOutput4> {
public:
@ -117,6 +117,12 @@ namespace dxvk {
IUnknown* pConcernedDevice,
UINT* pFlags) final;
HRESULT STDMETHODCALLTYPE CheckOverlayColorSpaceSupport(
DXGI_FORMAT Format,
DXGI_COLOR_SPACE_TYPE ColorSpace,
IUnknown* pConcernedDevice,
UINT* pFlags) final;
HRESULT GetDisplayMode(
DXGI_MODE_DESC* pMode,
DWORD ModeNum);