D3D12: Prevent crash due to missing debug layer
Destroying the adapter without the debug layer installed would crash the process upon access of the debug filters. Bug: dawn:460 Change-Id: I04819c5136af780fd3b981857bd87d69d4abc9c7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45560 Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
3e4b57b77e
commit
a9b211d202
|
@ -191,8 +191,13 @@ namespace dawn_native { namespace d3d12 {
|
|||
if (!GetInstance()->IsBackendValidationEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the debug layer is not installed, return immediately to avoid crashing the process.
|
||||
ComPtr<ID3D12InfoQueue> infoQueue;
|
||||
ASSERT_SUCCESS(mD3d12Device.As(&infoQueue));
|
||||
if (FAILED(mD3d12Device.As(&infoQueue))) {
|
||||
return;
|
||||
}
|
||||
|
||||
infoQueue->PopRetrievalFilter();
|
||||
infoQueue->PopStorageFilter();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue