mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
remove DeviceError::ResourceCreationFailed
This commit is contained in:
parent
918fdc98b5
commit
e10e17907f
@ -336,8 +336,6 @@ pub enum DeviceError {
|
||||
Lost,
|
||||
#[error("Not enough memory left.")]
|
||||
OutOfMemory,
|
||||
#[error("Creation of a resource failed for a reason other than running out of memory.")]
|
||||
ResourceCreationFailed,
|
||||
#[error(transparent)]
|
||||
DeviceMismatch(#[from] Box<DeviceMismatch>),
|
||||
}
|
||||
@ -345,8 +343,7 @@ pub enum DeviceError {
|
||||
impl WebGpuError for DeviceError {
|
||||
fn webgpu_error_type(&self) -> ErrorType {
|
||||
match self {
|
||||
DeviceError::DeviceMismatch(e) => e.webgpu_error_type(),
|
||||
Self::ResourceCreationFailed => ErrorType::OutOfMemory,
|
||||
Self::DeviceMismatch(e) => e.webgpu_error_type(),
|
||||
Self::Lost => ErrorType::DeviceLost,
|
||||
Self::OutOfMemory => ErrorType::OutOfMemory,
|
||||
}
|
||||
@ -361,7 +358,6 @@ impl DeviceError {
|
||||
match error {
|
||||
hal::DeviceError::Lost => Self::Lost,
|
||||
hal::DeviceError::OutOfMemory => Self::OutOfMemory,
|
||||
hal::DeviceError::ResourceCreationFailed => Self::ResourceCreationFailed,
|
||||
hal::DeviceError::Unexpected => Self::Lost,
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,7 +221,6 @@ impl Drop for Queue {
|
||||
self.device.handle_hal_error(e); // will lose the device
|
||||
break;
|
||||
}
|
||||
hal::DeviceError::ResourceCreationFailed => unreachable!(),
|
||||
hal::DeviceError::Unexpected => {
|
||||
panic!(
|
||||
"We ran into an unexpected error while waiting on the last successful submission to complete!"
|
||||
|
||||
@ -378,7 +378,6 @@ impl Device {
|
||||
match error {
|
||||
hal::DeviceError::OutOfMemory
|
||||
| hal::DeviceError::Lost
|
||||
| hal::DeviceError::ResourceCreationFailed
|
||||
| hal::DeviceError::Unexpected => {
|
||||
self.lose(&error.to_string());
|
||||
}
|
||||
|
||||
@ -996,7 +996,7 @@ impl crate::Adapter for super::Adapter {
|
||||
{
|
||||
Some(unsafe {
|
||||
Self::create_shader_clear_program(gl, self.shared.es)
|
||||
.ok_or(crate::DeviceError::ResourceCreationFailed)?
|
||||
.ok_or(crate::DeviceError::Lost)?
|
||||
})
|
||||
} else {
|
||||
// If we don't need the workaround, don't waste time and resources compiling the clear program
|
||||
|
||||
@ -375,8 +375,6 @@ pub enum DeviceError {
|
||||
OutOfMemory,
|
||||
#[error("Device is lost")]
|
||||
Lost,
|
||||
#[error("Creation of a resource failed for a reason other than running out of memory.")]
|
||||
ResourceCreationFailed,
|
||||
#[error("Unexpected error variant (driver implementation is at fault)")]
|
||||
Unexpected,
|
||||
}
|
||||
|
||||
@ -1463,7 +1463,7 @@ impl crate::Device for super::Device {
|
||||
Some(counter) => counter,
|
||||
None => {
|
||||
log::error!("Failed to obtain timestamp counter set.");
|
||||
return Err(crate::DeviceError::ResourceCreationFailed);
|
||||
return Err(crate::DeviceError::Unexpected);
|
||||
}
|
||||
};
|
||||
csb_desc.set_counter_set(timestamp_counter);
|
||||
@ -1473,7 +1473,7 @@ impl crate::Device for super::Device {
|
||||
Ok(buffer) => buffer,
|
||||
Err(err) => {
|
||||
log::error!("Failed to create counter sample buffer: {:?}", err);
|
||||
return Err(crate::DeviceError::ResourceCreationFailed);
|
||||
return Err(crate::DeviceError::Unexpected);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -752,7 +752,7 @@ impl super::Device {
|
||||
.contains(wgt::Features::VULKAN_EXTERNAL_MEMORY_WIN32)
|
||||
{
|
||||
log::error!("Vulkan driver does not support VK_KHR_external_memory_win32");
|
||||
return Err(crate::DeviceError::ResourceCreationFailed);
|
||||
return Err(crate::DeviceError::Unexpected);
|
||||
}
|
||||
|
||||
let mut external_memory_image_info = vk::ExternalMemoryImageCreateInfo::default()
|
||||
@ -780,7 +780,7 @@ impl super::Device {
|
||||
image.requirements.memory_type_bits,
|
||||
vk::MemoryPropertyFlags::DEVICE_LOCAL,
|
||||
)
|
||||
.ok_or(crate::DeviceError::ResourceCreationFailed)?;
|
||||
.ok_or(crate::DeviceError::Unexpected)?;
|
||||
|
||||
let memory_allocate_info = vk::MemoryAllocateInfo::default()
|
||||
.allocation_size(image.requirements.size)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user