diff --git a/src/dxgi/dxgi_adapter.cpp b/src/dxgi/dxgi_adapter.cpp index 1f05105c0..83b3e3ec2 100644 --- a/src/dxgi/dxgi_adapter.cpp +++ b/src/dxgi/dxgi_adapter.cpp @@ -89,6 +89,7 @@ namespace dxvk { || riid == __uuidof(IDXGIAdapter1) || riid == __uuidof(IDXGIAdapter2) || riid == __uuidof(IDXGIAdapter3) + || riid == __uuidof(IDXGIAdapter4) || riid == __uuidof(IDXGIDXVKAdapter)) { *ppvObject = ref(this); return S_OK; @@ -158,8 +159,8 @@ namespace dxvk { if (pDesc == nullptr) return E_INVALIDARG; - DXGI_ADAPTER_DESC2 desc; - HRESULT hr = GetDesc2(&desc); + DXGI_ADAPTER_DESC3 desc; + HRESULT hr = GetDesc3(&desc); if (SUCCEEDED(hr)) { std::memcpy(pDesc->Description, desc.Description, sizeof(pDesc->Description)); @@ -182,8 +183,8 @@ namespace dxvk { if (pDesc == nullptr) return E_INVALIDARG; - DXGI_ADAPTER_DESC2 desc; - HRESULT hr = GetDesc2(&desc); + DXGI_ADAPTER_DESC3 desc; + HRESULT hr = GetDesc3(&desc); if (SUCCEEDED(hr)) { std::memcpy(pDesc->Description, desc.Description, sizeof(pDesc->Description)); @@ -206,6 +207,34 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE DxgiAdapter::GetDesc2(DXGI_ADAPTER_DESC2* pDesc) { if (pDesc == nullptr) return E_INVALIDARG; + + DXGI_ADAPTER_DESC3 desc; + HRESULT hr = GetDesc3(&desc); + + if (SUCCEEDED(hr)) { + std::memcpy(pDesc->Description, desc.Description, sizeof(pDesc->Description)); + + pDesc->VendorId = desc.VendorId; + pDesc->DeviceId = desc.DeviceId; + pDesc->SubSysId = desc.SubSysId; + pDesc->Revision = desc.Revision; + pDesc->DedicatedVideoMemory = desc.DedicatedVideoMemory; + pDesc->DedicatedSystemMemory = desc.DedicatedSystemMemory; + pDesc->SharedSystemMemory = desc.SharedSystemMemory; + pDesc->AdapterLuid = desc.AdapterLuid; + pDesc->Flags = desc.Flags; + pDesc->GraphicsPreemptionGranularity = desc.GraphicsPreemptionGranularity; + pDesc->ComputePreemptionGranularity = desc.ComputePreemptionGranularity; + } + + return hr; + } + + + HRESULT STDMETHODCALLTYPE DxgiAdapter::GetDesc3( + DXGI_ADAPTER_DESC3* pDesc) { + if (pDesc == nullptr) + return E_INVALIDARG; const DxgiOptions* options = m_factory->GetOptions(); @@ -271,7 +300,7 @@ namespace dxvk { pDesc->DedicatedSystemMemory = 0; pDesc->SharedSystemMemory = sharedMemory; pDesc->AdapterLuid = LUID { 0, 0 }; - pDesc->Flags = 0; + pDesc->Flags = DXGI_ADAPTER_FLAG3_NONE; pDesc->GraphicsPreemptionGranularity = DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY; pDesc->ComputePreemptionGranularity = DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY; @@ -282,8 +311,8 @@ namespace dxvk { return S_OK; } - - + + HRESULT STDMETHODCALLTYPE DxgiAdapter::QueryVideoMemoryInfo( UINT NodeIndex, DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup, diff --git a/src/dxgi/dxgi_adapter.h b/src/dxgi/dxgi_adapter.h index 864a55d9d..a0c8bc903 100644 --- a/src/dxgi/dxgi_adapter.h +++ b/src/dxgi/dxgi_adapter.h @@ -75,6 +75,9 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE GetDesc2( DXGI_ADAPTER_DESC2* pDesc) final; + HRESULT STDMETHODCALLTYPE GetDesc3( + DXGI_ADAPTER_DESC3* pDesc) final; + HRESULT STDMETHODCALLTYPE QueryVideoMemoryInfo( UINT NodeIndex, DXGI_MEMORY_SEGMENT_GROUP MemorySegmentGroup, diff --git a/src/dxgi/dxgi_interfaces.h b/src/dxgi/dxgi_interfaces.h index 02cec1fea..15fc0d04d 100644 --- a/src/dxgi/dxgi_interfaces.h +++ b/src/dxgi/dxgi_interfaces.h @@ -86,7 +86,7 @@ IDXGIVkSwapChain : public IUnknown { * this interface. */ MIDL_INTERFACE("907bf281-ea3c-43b4-a8e4-9f231107b4ff") -IDXGIDXVKAdapter : public IDXGIAdapter3 { +IDXGIDXVKAdapter : public IDXGIAdapter4 { virtual dxvk::Rc STDMETHODCALLTYPE GetDXVKAdapter() = 0; virtual dxvk::Rc STDMETHODCALLTYPE GetDXVKInstance() = 0;