mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
remove oom_panic feature
This commit is contained in:
parent
71cce67665
commit
e78bc98d1b
@ -166,10 +166,6 @@ portable-atomic = ["dep:portable-atomic"]
|
|||||||
### Internal Debugging Features ###
|
### Internal Debugging Features ###
|
||||||
###################################
|
###################################
|
||||||
|
|
||||||
# Panic when running into an out-of-memory error (for debugging purposes).
|
|
||||||
#
|
|
||||||
# Only affects the d3d12 and vulkan backends.
|
|
||||||
oom_panic = []
|
|
||||||
# Panic when running into a device lost error (for debugging purposes).
|
# Panic when running into a device lost error (for debugging purposes).
|
||||||
# Only affects the d3d12 and vulkan backends.
|
# Only affects the d3d12 and vulkan backends.
|
||||||
device_lost_panic = []
|
device_lost_panic = []
|
||||||
|
|||||||
@ -11,11 +11,7 @@ impl<T> HResult<T> for windows::core::Result<T> {
|
|||||||
log::error!("{} failed: {}", description, err);
|
log::error!("{} failed: {}", description, err);
|
||||||
|
|
||||||
match err.code() {
|
match err.code() {
|
||||||
Foundation::E_OUTOFMEMORY => {
|
Foundation::E_OUTOFMEMORY => crate::DeviceError::OutOfMemory,
|
||||||
#[cfg(feature = "oom_panic")]
|
|
||||||
panic!("{description} failed: Out of memory");
|
|
||||||
crate::DeviceError::OutOfMemory
|
|
||||||
}
|
|
||||||
Dxgi::DXGI_ERROR_DEVICE_RESET | Dxgi::DXGI_ERROR_DEVICE_REMOVED => {
|
Dxgi::DXGI_ERROR_DEVICE_RESET | Dxgi::DXGI_ERROR_DEVICE_REMOVED => {
|
||||||
#[cfg(feature = "device_lost_panic")]
|
#[cfg(feature = "device_lost_panic")]
|
||||||
panic!("{description} failed: Device lost ({err})");
|
panic!("{description} failed: Device lost ({err})");
|
||||||
|
|||||||
@ -1470,13 +1470,8 @@ fn get_unexpected_err(_err: vk::Result) -> crate::DeviceError {
|
|||||||
crate::DeviceError::Unexpected
|
crate::DeviceError::Unexpected
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns [`crate::DeviceError::OutOfMemory`] or panics if the `oom_panic`
|
/// Returns [`crate::DeviceError::OutOfMemory`].
|
||||||
/// feature flag is enabled.
|
|
||||||
fn get_oom_err(_err: vk::Result) -> crate::DeviceError {
|
fn get_oom_err(_err: vk::Result) -> crate::DeviceError {
|
||||||
#[cfg(feature = "oom_panic")]
|
|
||||||
panic!("Out of memory ({_err:?})");
|
|
||||||
|
|
||||||
#[allow(unreachable_code)]
|
|
||||||
crate::DeviceError::OutOfMemory
|
crate::DeviceError::OutOfMemory
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user