diff --git a/wgpu-hal/src/dx12/device.rs b/wgpu-hal/src/dx12/device.rs index 95a7f0627..2715b5c94 100644 --- a/wgpu-hal/src/dx12/device.rs +++ b/wgpu-hal/src/dx12/device.rs @@ -85,7 +85,7 @@ impl super::Device { } .into_device_result("Zero buffer creation")?; - let zero_buffer = zero_buffer.ok_or(crate::DeviceError::ResourceCreationFailed)?; + let zero_buffer = zero_buffer.ok_or(crate::DeviceError::Unexpected)?; // Note: without `D3D12_HEAP_FLAG_CREATE_NOT_ZEROED` // this resource is zeroed by default. @@ -114,7 +114,7 @@ impl super::Device { ) } .into_device_result("Command signature creation")?; - signature.ok_or(crate::DeviceError::ResourceCreationFailed) + signature.ok_or(crate::DeviceError::Unexpected) } let shared = super::DeviceShared { @@ -1637,7 +1637,7 @@ impl crate::Device for super::Device { } .into_device_result("Query heap creation")?; - let raw = raw.ok_or(crate::DeviceError::ResourceCreationFailed)?; + let raw = raw.ok_or(crate::DeviceError::Unexpected)?; if let Some(label) = desc.label { unsafe { raw.SetName(&windows::core::HSTRING::from(label)) } diff --git a/wgpu-hal/src/dx12/suballocation.rs b/wgpu-hal/src/dx12/suballocation.rs index 77fe5d480..bdb3e8512 100644 --- a/wgpu-hal/src/dx12/suballocation.rs +++ b/wgpu-hal/src/dx12/suballocation.rs @@ -94,7 +94,7 @@ pub(crate) fn create_buffer_resource( } .into_device_result("Placed buffer creation")?; - let resource = resource.ok_or(crate::DeviceError::ResourceCreationFailed)?; + let resource = resource.ok_or(crate::DeviceError::Unexpected)?; device .counters @@ -141,7 +141,7 @@ pub(crate) fn create_texture_resource( } .into_device_result("Placed texture creation")?; - let resource = resource.ok_or(crate::DeviceError::ResourceCreationFailed)?; + let resource = resource.ok_or(crate::DeviceError::Unexpected)?; device .counters @@ -265,7 +265,7 @@ pub(crate) fn create_committed_buffer_resource( } .into_device_result("Committed buffer creation")?; - resource.ok_or(crate::DeviceError::ResourceCreationFailed) + resource.ok_or(crate::DeviceError::Unexpected) } pub(crate) fn create_committed_texture_resource( @@ -302,5 +302,5 @@ pub(crate) fn create_committed_texture_resource( } .into_device_result("Committed texture creation")?; - resource.ok_or(crate::DeviceError::ResourceCreationFailed) + resource.ok_or(crate::DeviceError::Unexpected) }