@@ -3,6 +3,7 @@ pub mod ascii_art;
33pub mod device;
44pub mod vendor;
55
6+ use ascii_art:: RED ;
67use ash:: * ;
78use device:: PhysicalDevice ;
89use std:: str;
@@ -20,7 +21,7 @@ pub fn fetch_device(instance: &Instance, device: vk::PhysicalDevice) {
2021
2122 let device = PhysicalDevice :: new ( instance, device) ;
2223
23- let info = get_device_info ( device) ;
24+ let info = get_device_info ( device, vendor . get_styles ( ) [ 0 ] ) ;
2425
2526 let empty = "" . to_string ( ) ;
2627 for i in 0 ..art. len ( ) . max ( info. len ( ) ) {
@@ -36,7 +37,7 @@ const BOLD: &str = "\x1B[1m";
3637const RESET : & str = "\x1B [0m" ;
3738const ALIGNMENT : & str = " " ;
3839
39- fn get_device_info ( device : PhysicalDevice ) -> Vec < String > {
40+ fn get_device_info ( device : PhysicalDevice , color : & str ) -> Vec < String > {
4041 let mut output: Vec < String > = Vec :: new ( ) ;
4142
4243 output. push ( format ! (
@@ -47,20 +48,27 @@ fn get_device_info(device: PhysicalDevice) -> Vec<String> {
4748 device. device_type. name( )
4849 ) ) ;
4950
51+ output. push ( format ! ( "{}========================================" , color) ) ;
52+
5053 output. push ( format ! (
51- "{}Device: 0x{:X} : 0x{:X} ({})" ,
54+ "{}{} Device: {} 0x{:X} : 0x{:X} ({})" ,
5255 ALIGNMENT ,
56+ color,
57+ RESET ,
5358 device. device_id,
5459 device. vendor_id,
5560 device. vendor. name( ) ,
5661 ) ) ;
5762
5863 output. push ( format ! (
59- "{}Driver: {} : {}" ,
60- ALIGNMENT , device. driver_name, device. driver_info
64+ "{}{} Driver: {} {} : {}" ,
65+ ALIGNMENT , color , RESET , device. driver_name, device. driver_info
6166 ) ) ;
6267
63- output. push ( format ! ( "{}API: {}" , ALIGNMENT , device. api_version, ) ) ;
68+ output. push ( format ! (
69+ "{}{}API: {}{}" ,
70+ ALIGNMENT , color, RESET , device. api_version,
71+ ) ) ;
6472
6573 output
6674}
0 commit comments