Browse Source

libobs-d3d11: Store device adapter index (for rebuilding)

jp9000 9 years ago
parent
commit
e4900751c3
2 changed files with 3 additions and 0 deletions
  1. 2 0
      libobs-d3d11/d3d11-subsystem.cpp
  2. 1 0
      libobs-d3d11/d3d11-subsystem.hpp

+ 2 - 0
libobs-d3d11/d3d11-subsystem.cpp

@@ -205,6 +205,8 @@ void gs_device::InitDevice(uint32_t adapterIdx)
 	D3D_FEATURE_LEVEL levelUsed = D3D_FEATURE_LEVEL_9_3;
 	D3D_FEATURE_LEVEL levelUsed = D3D_FEATURE_LEVEL_9_3;
 	HRESULT hr = 0;
 	HRESULT hr = 0;
 
 
+	adpIdx = adapterIdx;
+
 	uint32_t createFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
 	uint32_t createFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
 #ifdef _DEBUG
 #ifdef _DEBUG
 	//createFlags |= D3D11_CREATE_DEVICE_DEBUG;
 	//createFlags |= D3D11_CREATE_DEVICE_DEBUG;

+ 1 - 0
libobs-d3d11/d3d11-subsystem.hpp

@@ -625,6 +625,7 @@ struct gs_device {
 	ComPtr<IDXGIAdapter1>       adapter;
 	ComPtr<IDXGIAdapter1>       adapter;
 	ComPtr<ID3D11Device>        device;
 	ComPtr<ID3D11Device>        device;
 	ComPtr<ID3D11DeviceContext> context;
 	ComPtr<ID3D11DeviceContext> context;
+	uint32_t                    adpIdx = 0;
 
 
 	gs_texture_2d               *curRenderTarget = nullptr;
 	gs_texture_2d               *curRenderTarget = nullptr;
 	gs_zstencil_buffer          *curZStencilBuffer = nullptr;
 	gs_zstencil_buffer          *curZStencilBuffer = nullptr;