Fallback when DirectX debug layer is unavailable
This commit is contained in:
@@ -549,7 +549,19 @@ bool GPUDeviceDX11::Init()
|
||||
else
|
||||
#endif
|
||||
{
|
||||
VALIDATE_DIRECTX_CALL(D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, NULL, flags, &targetFeatureLevel, 1, D3D11_SDK_VERSION, &_device, &createdFeatureLevel, &_imContext));
|
||||
HRESULT createResult = D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, NULL, flags, &targetFeatureLevel, 1, D3D11_SDK_VERSION, &_device, &createdFeatureLevel, &_imContext);
|
||||
#if GPU_ENABLE_DIAGNOSTICS
|
||||
if (createResult == DXGI_ERROR_SDK_COMPONENT_MISSING)
|
||||
{
|
||||
// The Direct3D debug layer is an optional Windows component. Development builds
|
||||
// should remain usable when it is not installed, just like adapter probing above.
|
||||
flags &= ~D3D11_CREATE_DEVICE_DEBUG;
|
||||
createResult = D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, NULL, flags, &targetFeatureLevel, 1, D3D11_SDK_VERSION, &_device, &createdFeatureLevel, &_imContext);
|
||||
if (SUCCEEDED(createResult))
|
||||
LOG(Warning, "Direct3D SDK debug layers were requested, but not available. Continuing without them.");
|
||||
}
|
||||
#endif
|
||||
VALIDATE_DIRECTX_CALL(createResult);
|
||||
}
|
||||
if (!_device || !_imContext)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user