[Spice-devel] [PATCH 11/14] Get D3DKMTOpenAdapterFromDeviceName and D3DKMTOpenAdapterFromDeviceName independently
Frediano Ziglio
fziglio at redhat.com
Thu Sep 1 12:00:53 UTC 2016
There's no reason why we can't use one if the other is not present
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
vdagent/display_configuration.cpp | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/vdagent/display_configuration.cpp b/vdagent/display_configuration.cpp
index 86c4ea5..301e136 100644
--- a/vdagent/display_configuration.cpp
+++ b/vdagent/display_configuration.cpp
@@ -522,6 +522,7 @@ bool WDDMInterface::init_d3d_api()
return false;
}
+ bool result = false;
do {
_pfnClose_adapter = (PFND3DKMT_CLOSEADAPTER)
GetProcAddress(hModule, "D3DKMTCloseAdapter");
@@ -540,26 +541,18 @@ bool WDDMInterface::init_d3d_api()
break;
}
+ // we found all needed function, following are optionals
+ result = true;
+
_pfnOpen_adapter_device_name = (PFND3DKMT_OPENADAPTERFROMDEVICENAME)
GetProcAddress(hModule, "D3DKMTOpenAdapterFromDeviceName");
- if (!_pfnOpen_adapter_device_name) {
- break;
- }
_pfnOpen_adapter_gdi_name = (PFND3DKMT_OPENADAPTERFROMGDIDISPLAYNAME)
GetProcAddress(hModule, "D3DKMTOpenAdapterFromGdiDisplayName");
- if (!_pfnOpen_adapter_gdi_name) {
- break;
- }
-
}
while(0);
- //Did we get them ?
- if (!_pfnClose_adapter || !_pfnOpen_adapter_hdc || !_pfnEscape) {
- return false;
- }
- return true;
+ return result;
}
D3D_HANDLE WDDMInterface::adapter_handle(LPCTSTR device_name)
--
2.7.4
More information about the Spice-devel
mailing list