mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 01:03:41 +01:00
D3D11: Also properly check for the no-adapters case.
This commit is contained in:
1 parent
0320b4961b
commit
6117e37a14
1 file changed
+9
-4
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user