Skip to content
Permalink
Browse files

D3D11: Also properly check for the no-adapters case.

  • Loading branch information...
hrydgard committed May 15, 2019
1 parent 0320b49 commit 6117e37a14bb166552ef6173afbb6a7254f0a71f
Showing with 9 additions and 4 deletions.
  1. +9 −4 Windows/GPU/D3D11Context.cpp
@@ -123,10 +123,15 @@ bool D3D11Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) {
}
}

chosenAdapterName = adapterNames[chosenAdapter];
hr = CreateTheDevice(adapters[chosenAdapter]);
for (int i = 0; i < (int)adapters.size(); i++) {
adapters[i]->Release();
if (!adapters.empty()) {
chosenAdapterName = adapterNames[chosenAdapter];
hr = CreateTheDevice(adapters[chosenAdapter]);
for (int i = 0; i < (int)adapters.size(); i++) {
adapters[i]->Release();
}
} else {
// No adapters found. Trip the error path below.
hr = E_FAIL;
}
}
}

0 comments on commit 6117e37

Please sign in to comment.
You can’t perform that action at this time.