Fallback to D3D11 devices without debug layers when unavailable
This commit is contained in:
@@ -71,7 +71,28 @@ static bool TryCreateDevice(IDXGIAdapter* adapter, D3D_FEATURE_LEVEL maxFeatureL
|
|||||||
context->Release();
|
context->Release();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#if GPU_ENABLE_DIAGNOSTICS
|
||||||
|
deviceFlags &= ~D3D11_CREATE_DEVICE_DEBUG;
|
||||||
|
if (SUCCEEDED(D3D11CreateDevice(
|
||||||
|
adapter,
|
||||||
|
D3D_DRIVER_TYPE_UNKNOWN,
|
||||||
|
NULL,
|
||||||
|
deviceFlags,
|
||||||
|
&featureLevels[levelIndex],
|
||||||
|
ARRAY_COUNT(featureLevels) - levelIndex,
|
||||||
|
D3D11_SDK_VERSION,
|
||||||
|
&device,
|
||||||
|
featureLevel,
|
||||||
|
&context
|
||||||
|
)))
|
||||||
|
{
|
||||||
|
LOG(Warning, "Direct3D SDK debug layers were requested, but not available.");
|
||||||
|
device->Release();
|
||||||
|
context->Release();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user