Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/d3d12/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use std::{
use log::{debug, warn, Level};
use windows::Win32::{
Foundation::E_OUTOFMEMORY,
Graphics::{Direct3D12::*, Dxgi::Common::DXGI_FORMAT},
Graphics::{
Direct3D12::*,
Dxgi::{Common::DXGI_FORMAT, DXGI_ERROR_DEVICE_REMOVED},
},
};

#[cfg(feature = "public-winapi")]
Expand Down Expand Up @@ -954,6 +957,12 @@ impl Allocator {
}
}
} {
if e.code() == DXGI_ERROR_DEVICE_REMOVED {
return Err(AllocationError::Internal(format!(
"ID3D12Device::CreateCommittedResource DEVICE_REMOVED: {:?}",
unsafe { self.device.GetDeviceRemovedReason() }
)));
}
return Err(AllocationError::Internal(format!(
"ID3D12Device::CreateCommittedResource failed: {}",
e
Expand Down Expand Up @@ -1064,6 +1073,12 @@ impl Allocator {
}
}
} {
if e.code() == DXGI_ERROR_DEVICE_REMOVED {
return Err(AllocationError::Internal(format!(
"ID3D12Device::CreatePlacedResource DEVICE_REMOVED: {:?}",
unsafe { self.device.GetDeviceRemovedReason() }
)));
}
return Err(AllocationError::Internal(format!(
"ID3D12Device::CreatePlacedResource failed: {}",
e
Expand Down