@@ -3,7 +3,6 @@ pub mod ascii_art;
33pub mod device;
44pub mod vendor;
55
6- use ascii_art:: RED ;
76use ash:: * ;
87use device:: PhysicalDevice ;
98use std:: str;
@@ -40,18 +39,25 @@ const ALIGNMENT: &str = " ";
4039fn get_device_info ( device : PhysicalDevice , color : & str ) -> Vec < String > {
4140 let mut output: Vec < String > = Vec :: new ( ) ;
4241
43- output . push ( format ! (
44- "{}{} : {} {}" ,
42+ let x = format ! (
43+ "{}{}{}{}: {}" ,
4544 BOLD ,
45+ color,
4646 device. device_name,
4747 RESET ,
4848 device. device_type. name( )
49- ) ) ;
49+ ) ;
50+
51+ let length = device. device_name . len ( ) + device. device_type . name ( ) . len ( ) + 3 ;
52+
53+ output. push ( x. clone ( ) ) ;
54+
55+ let underline: String = std:: iter:: repeat ( "=" ) . take ( length) . collect ( ) ;
5056
51- output. push ( format ! ( "{}======================================== " , color) ) ;
57+ output. push ( format ! ( "{}{}{} " , BOLD , color, underline ) ) ;
5258
5359 output. push ( format ! (
54- "{}{}Device: {} 0x{:X} : 0x{:X} ({})" ,
60+ "{}{}Device{}: 0x{:X} : 0x{:X} ({})" ,
5561 ALIGNMENT ,
5662 color,
5763 RESET ,
@@ -61,12 +67,12 @@ fn get_device_info(device: PhysicalDevice, color: &str) -> Vec<String> {
6167 ) ) ;
6268
6369 output. push ( format ! (
64- "{}{}Driver: {} {} : {}" ,
70+ "{}{}Driver{}: {} : {}" ,
6571 ALIGNMENT , color, RESET , device. driver_name, device. driver_info
6672 ) ) ;
6773
6874 output. push ( format ! (
69- "{}{}API: {} {}" ,
75+ "{}{}API{}: {}" ,
7076 ALIGNMENT , color, RESET , device. api_version,
7177 ) ) ;
7278
0 commit comments