@@ -129,7 +129,6 @@ impl Default for Allocation {
129129#[ derive( Debug ) ]
130130pub ( crate ) struct MemoryBlock {
131131 pub ( crate ) device_memory : vk:: DeviceMemory ,
132- #[ cfg( feature = "visualizer" ) ]
133132 pub ( crate ) size : u64 ,
134133 pub ( crate ) mapped_ptr : * mut std:: ffi:: c_void ,
135134 pub ( crate ) sub_allocator : Box < dyn allocator:: SubAllocator > ,
@@ -192,7 +191,6 @@ impl MemoryBlock {
192191
193192 Ok ( Self {
194193 device_memory,
195- #[ cfg( feature = "visualizer" ) ]
196194 size,
197195 mapped_ptr,
198196 sub_allocator,
@@ -456,25 +454,28 @@ pub struct Allocator {
456454impl fmt:: Debug for Allocator {
457455 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
458456 let mut allocation_report = vec ! [ ] ;
457+ let mut total_reserved_size_in_bytes = 0 ;
459458
460459 for memory_type in & self . memory_types {
461460 for block in memory_type. memory_blocks . iter ( ) . flatten ( ) {
461+ total_reserved_size_in_bytes += block. size ;
462462 allocation_report. extend ( block. sub_allocator . report_allocations ( ) )
463463 }
464464 }
465465
466- let total_size_in_bytes = allocation_report. iter ( ) . map ( |report| report. size ) . sum ( ) ;
466+ let total_used_size_in_bytes = allocation_report. iter ( ) . map ( |report| report. size ) . sum ( ) ;
467467
468468 allocation_report. sort_by_key ( |alloc| std:: cmp:: Reverse ( alloc. size ) ) ;
469469
470470 writeln ! (
471471 f,
472- "================================================================"
472+ "================================================================" ,
473473 ) ?;
474474 writeln ! (
475475 f,
476- "ALLOCATION BREAKDOWN ({})" ,
477- fmt_bytes( total_size_in_bytes)
476+ "ALLOCATION BREAKDOWN ({} / {})" ,
477+ fmt_bytes( total_used_size_in_bytes) ,
478+ fmt_bytes( total_reserved_size_in_bytes) ,
478479 ) ?;
479480
480481 let max_num_allocations_to_print = f. precision ( ) . map_or ( usize:: MAX , |n| n) ;
0 commit comments