@@ -451,10 +451,9 @@ impl crate::Device for super::Device {
451
451
452
452
unsafe fn destroy_buffer ( & self , buffer : super :: Buffer ) {
453
453
suballocation:: free_resource (
454
- self ,
454
+ suballocation :: DeviceAllocationContext :: from ( self ) ,
455
455
buffer. resource ,
456
456
buffer. allocation ,
457
- & self . mem_allocator ,
458
457
) ;
459
458
460
459
self . counters . buffers . sub ( 1 ) ;
@@ -542,11 +541,9 @@ impl crate::Device for super::Device {
542
541
543
542
unsafe fn destroy_texture ( & self , texture : super :: Texture ) {
544
543
suballocation:: free_resource (
545
- self ,
544
+ suballocation :: DeviceAllocationContext :: from ( self ) ,
546
545
texture. resource ,
547
546
texture. allocation ,
548
- // SAFETY: for allocations to exist, the allocator must exist
549
- & self . mem_allocator ,
550
547
) ;
551
548
552
549
self . counters . textures . sub ( 1 ) ;
@@ -1673,10 +1670,9 @@ impl crate::Device for super::Device {
1673
1670
1674
1671
if let Some ( sampler_buffer) = group. sampler_index_buffer {
1675
1672
suballocation:: free_resource (
1676
- self ,
1673
+ suballocation :: DeviceAllocationContext :: from ( self ) ,
1677
1674
sampler_buffer. buffer ,
1678
1675
sampler_buffer. allocation ,
1679
- & self . mem_allocator ,
1680
1676
) ;
1681
1677
}
1682
1678
@@ -2320,10 +2316,9 @@ impl crate::Device for super::Device {
2320
2316
acceleration_structure : super :: AccelerationStructure ,
2321
2317
) {
2322
2318
suballocation:: free_resource (
2323
- self ,
2319
+ suballocation :: DeviceAllocationContext :: from ( self ) ,
2324
2320
acceleration_structure. resource ,
2325
2321
acceleration_structure. allocation ,
2326
- & self . mem_allocator ,
2327
2322
) ;
2328
2323
}
2329
2324
0 commit comments