File tree Expand file tree Collapse file tree 7 files changed +6
-14
lines changed Expand file tree Collapse file tree 7 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -336,17 +336,14 @@ pub enum DeviceError {
336
336
Lost ,
337
337
#[ error( "Not enough memory left." ) ]
338
338
OutOfMemory ,
339
- #[ error( "Creation of a resource failed for a reason other than running out of memory." ) ]
340
- ResourceCreationFailed ,
341
339
#[ error( transparent) ]
342
340
DeviceMismatch ( #[ from] Box < DeviceMismatch > ) ,
343
341
}
344
342
345
343
impl WebGpuError for DeviceError {
346
344
fn webgpu_error_type ( & self ) -> ErrorType {
347
345
match self {
348
- DeviceError :: DeviceMismatch ( e) => e. webgpu_error_type ( ) ,
349
- Self :: ResourceCreationFailed => ErrorType :: OutOfMemory ,
346
+ Self :: DeviceMismatch ( e) => e. webgpu_error_type ( ) ,
350
347
Self :: Lost => ErrorType :: DeviceLost ,
351
348
Self :: OutOfMemory => ErrorType :: OutOfMemory ,
352
349
}
@@ -361,7 +358,6 @@ impl DeviceError {
361
358
match error {
362
359
hal:: DeviceError :: Lost => Self :: Lost ,
363
360
hal:: DeviceError :: OutOfMemory => Self :: OutOfMemory ,
364
- hal:: DeviceError :: ResourceCreationFailed => Self :: ResourceCreationFailed ,
365
361
hal:: DeviceError :: Unexpected => Self :: Lost ,
366
362
}
367
363
}
Original file line number Diff line number Diff line change @@ -221,7 +221,6 @@ impl Drop for Queue {
221
221
self . device . handle_hal_error ( e) ; // will lose the device
222
222
break ;
223
223
}
224
- hal:: DeviceError :: ResourceCreationFailed => unreachable ! ( ) ,
225
224
hal:: DeviceError :: Unexpected => {
226
225
panic ! (
227
226
"We ran into an unexpected error while waiting on the last successful submission to complete!"
Original file line number Diff line number Diff line change @@ -378,7 +378,6 @@ impl Device {
378
378
match error {
379
379
hal:: DeviceError :: OutOfMemory
380
380
| hal:: DeviceError :: Lost
381
- | hal:: DeviceError :: ResourceCreationFailed
382
381
| hal:: DeviceError :: Unexpected => {
383
382
self . lose ( & error. to_string ( ) ) ;
384
383
}
Original file line number Diff line number Diff line change @@ -996,7 +996,7 @@ impl crate::Adapter for super::Adapter {
996
996
{
997
997
Some ( unsafe {
998
998
Self :: create_shader_clear_program ( gl, self . shared . es )
999
- . ok_or ( crate :: DeviceError :: ResourceCreationFailed ) ?
999
+ . ok_or ( crate :: DeviceError :: Lost ) ?
1000
1000
} )
1001
1001
} else {
1002
1002
// If we don't need the workaround, don't waste time and resources compiling the clear program
Original file line number Diff line number Diff line change @@ -375,8 +375,6 @@ pub enum DeviceError {
375
375
OutOfMemory ,
376
376
#[ error( "Device is lost" ) ]
377
377
Lost ,
378
- #[ error( "Creation of a resource failed for a reason other than running out of memory." ) ]
379
- ResourceCreationFailed ,
380
378
#[ error( "Unexpected error variant (driver implementation is at fault)" ) ]
381
379
Unexpected ,
382
380
}
Original file line number Diff line number Diff line change @@ -1463,7 +1463,7 @@ impl crate::Device for super::Device {
1463
1463
Some ( counter) => counter,
1464
1464
None => {
1465
1465
log:: error!( "Failed to obtain timestamp counter set." ) ;
1466
- return Err ( crate :: DeviceError :: ResourceCreationFailed ) ;
1466
+ return Err ( crate :: DeviceError :: Unexpected ) ;
1467
1467
}
1468
1468
} ;
1469
1469
csb_desc. set_counter_set ( timestamp_counter) ;
@@ -1473,7 +1473,7 @@ impl crate::Device for super::Device {
1473
1473
Ok ( buffer) => buffer,
1474
1474
Err ( err) => {
1475
1475
log:: error!( "Failed to create counter sample buffer: {:?}" , err) ;
1476
- return Err ( crate :: DeviceError :: ResourceCreationFailed ) ;
1476
+ return Err ( crate :: DeviceError :: Unexpected ) ;
1477
1477
}
1478
1478
} ;
1479
1479
Original file line number Diff line number Diff line change @@ -752,7 +752,7 @@ impl super::Device {
752
752
. contains ( wgt:: Features :: VULKAN_EXTERNAL_MEMORY_WIN32 )
753
753
{
754
754
log:: error!( "Vulkan driver does not support VK_KHR_external_memory_win32" ) ;
755
- return Err ( crate :: DeviceError :: ResourceCreationFailed ) ;
755
+ return Err ( crate :: DeviceError :: Unexpected ) ;
756
756
}
757
757
758
758
let mut external_memory_image_info = vk:: ExternalMemoryImageCreateInfo :: default ( )
@@ -780,7 +780,7 @@ impl super::Device {
780
780
image. requirements . memory_type_bits ,
781
781
vk:: MemoryPropertyFlags :: DEVICE_LOCAL ,
782
782
)
783
- . ok_or ( crate :: DeviceError :: ResourceCreationFailed ) ?;
783
+ . ok_or ( crate :: DeviceError :: Unexpected ) ?;
784
784
785
785
let memory_allocate_info = vk:: MemoryAllocateInfo :: default ( )
786
786
. allocation_size ( image. requirements . size )
You can’t perform that action at this time.
0 commit comments