Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Unified Diff: webrtc/modules/desktop_capture/win/d3d_device.cc

Issue 2468083002: Remove the requirement of D3D_FEATURE_LEVEL_11_0, but export the D3D_FEATURE_LEVEL through APIs (Closed)
Patch Set: Resolve review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/win/d3d_device.cc
diff --git a/webrtc/modules/desktop_capture/win/d3d_device.cc b/webrtc/modules/desktop_capture/win/d3d_device.cc
index 67d12980787c68707abea63a5c3ebf2e68f055cf..078c0c4295f7b87eb279521acbe626dc1d274824 100644
--- a/webrtc/modules/desktop_capture/win/d3d_device.cc
+++ b/webrtc/modules/desktop_capture/win/d3d_device.cc
@@ -31,6 +31,7 @@ bool D3dDevice::Initialize(const ComPtr<IDXGIAdapter>& adapter) {
}
D3D_FEATURE_LEVEL feature_level;
+ // Default feature levels contain D3D 9.1 through D3D 11.0.
_com_error error = D3D11CreateDevice(
adapter.Get(), D3D_DRIVER_TYPE_UNKNOWN, nullptr,
D3D11_CREATE_DEVICE_BGRA_SUPPORT | D3D11_CREATE_DEVICE_SINGLETHREADED,
@@ -44,16 +45,18 @@ bool D3dDevice::Initialize(const ComPtr<IDXGIAdapter>& adapter) {
if (feature_level < D3D_FEATURE_LEVEL_11_0) {
LOG(LS_WARNING) << "D3D11CreateDevice returns an instance without DirectX "
- "11 support, level "
- << feature_level;
- return false;
+ "11 support, level " << feature_level
+ << ". Following initialization may fail.";
+ // D3D_FEATURE_LEVEL_11_0 is not officially documented on MSDN to be a
+ // requirement of Dxgi duplicator APIs.
}
error = d3d_device_.As(&dxgi_device_);
if (error.Error() != S_OK || !dxgi_device_) {
LOG(LS_WARNING) << "ID3D11Device is not an implementation of IDXGIDevice, "
"this usually means the system does not support DirectX "
- "11";
+ "11. Error "
+ << error.ErrorMessage() << " with code " << error.Error();
return false;
}
« no previous file with comments | « no previous file | webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698