mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 20:52:10 +01:00
[dxgi] Implemented IDXGIFactory1 and IDXGIAdapter1 extensions
This commit is contained in:
parent
26e662e12c
commit
f5dd030074
@ -27,6 +27,7 @@ namespace dxvk {
|
||||
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
|
||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapter);
|
||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIAdapter1);
|
||||
COM_QUERY_IFACE(riid, ppvObject, IDXVKAdapter);
|
||||
|
||||
Logger::warn("DxgiAdapter::QueryInterface: Unknown interface query");
|
||||
@ -71,6 +72,25 @@ namespace dxvk {
|
||||
|
||||
|
||||
HRESULT DxgiAdapter::GetDesc(DXGI_ADAPTER_DESC* pDesc) {
|
||||
DXGI_ADAPTER_DESC1 desc1;
|
||||
HRESULT hr = this->GetDesc1(&desc1);
|
||||
|
||||
if (SUCCEEDED(hr)) {
|
||||
pDesc->VendorId = desc1.VendorId;
|
||||
pDesc->DeviceId = desc1.DeviceId;
|
||||
pDesc->SubSysId = desc1.SubSysId;
|
||||
pDesc->Revision = desc1.Revision;
|
||||
pDesc->DedicatedVideoMemory = desc1.DedicatedVideoMemory;
|
||||
pDesc->DedicatedSystemMemory = desc1.DedicatedSystemMemory;
|
||||
pDesc->SharedSystemMemory = desc1.SharedSystemMemory;
|
||||
pDesc->AdapterLuid = desc1.AdapterLuid;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT DxgiAdapter::GetDesc1(DXGI_ADAPTER_DESC1* pDesc) {
|
||||
if (pDesc == nullptr)
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
|
||||
@ -100,6 +120,7 @@ namespace dxvk {
|
||||
pDesc->DedicatedSystemMemory = 0;
|
||||
pDesc->SharedSystemMemory = sharedMemory;
|
||||
pDesc->AdapterLuid = LUID { 0, 0 }; // TODO implement
|
||||
pDesc->Flags = 0;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,9 @@ namespace dxvk {
|
||||
HRESULT GetDesc(
|
||||
DXGI_ADAPTER_DESC *pDesc) final;
|
||||
|
||||
HRESULT GetDesc1(
|
||||
DXGI_ADAPTER_DESC1 *pDesc) final;
|
||||
|
||||
Rc<DxvkAdapter> GetDXVKAdapter() final;
|
||||
|
||||
private:
|
||||
|
@ -21,6 +21,7 @@ namespace dxvk {
|
||||
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
|
||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIFactory);
|
||||
COM_QUERY_IFACE(riid, ppvObject, IDXGIFactory1);
|
||||
|
||||
Logger::warn("DxgiFactory::QueryInterface: Unknown interface query");
|
||||
return E_NOINTERFACE;
|
||||
@ -66,6 +67,20 @@ namespace dxvk {
|
||||
if (ppAdapter == nullptr)
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
|
||||
IDXGIAdapter1* handle = nullptr;
|
||||
HRESULT hr = this->EnumAdapters1(Adapter, &handle);
|
||||
if (SUCCEEDED(hr))
|
||||
*ppAdapter = handle;
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
HRESULT DxgiFactory::EnumAdapters1(
|
||||
UINT Adapter,
|
||||
IDXGIAdapter1** ppAdapter) {
|
||||
if (ppAdapter == nullptr)
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
|
||||
if (Adapter >= m_adapters.size())
|
||||
return DXGI_ERROR_NOT_FOUND;
|
||||
|
||||
@ -90,4 +105,10 @@ namespace dxvk {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
BOOL DxgiFactory::IsCurrent() {
|
||||
Logger::warn("DxgiFactory::IsCurrent: Stub");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
namespace dxvk {
|
||||
|
||||
class DxgiFactory : public DxgiObject<IDXGIFactory> {
|
||||
class DxgiFactory : public DxgiObject<IDXGIFactory1> {
|
||||
|
||||
public:
|
||||
|
||||
@ -36,6 +36,10 @@ namespace dxvk {
|
||||
UINT Adapter,
|
||||
IDXGIAdapter** ppAdapter) final;
|
||||
|
||||
HRESULT EnumAdapters1(
|
||||
UINT Adapter,
|
||||
IDXGIAdapter1** ppAdapter) final;
|
||||
|
||||
HRESULT GetWindowAssociation(
|
||||
HWND *pWindowHandle) final;
|
||||
|
||||
@ -43,6 +47,8 @@ namespace dxvk {
|
||||
HWND WindowHandle,
|
||||
UINT Flags) final;
|
||||
|
||||
BOOL IsCurrent();
|
||||
|
||||
private:
|
||||
|
||||
Rc<DxvkInstance> m_instance;
|
||||
|
@ -16,7 +16,7 @@ namespace dxvk {
|
||||
* this interface.
|
||||
*/
|
||||
MIDL_INTERFACE("907bf281-ea3c-43b4-a8e4-9f231107b4ff")
|
||||
IDXVKAdapter : public IDXGIAdapter {
|
||||
IDXVKAdapter : public IDXGIAdapter1 {
|
||||
static const GUID guid;
|
||||
|
||||
virtual dxvk::Rc<dxvk::DxvkAdapter> GetDXVKAdapter() = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user