File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ enum Commands {
182
182
/// For MSL, this is the shader language version as an integer in format
183
183
/// <MMmmpp>(30100), or a version in the format MAJ_MIN (3_1), or MAJ.MIN (3.1).
184
184
///
185
+ /// For SPIR-V, if this is the string "raw-id", then shows raw ID values instead of friendly names.
185
186
#[ arg( short, long) ]
186
187
version : Option < String > ,
187
188
} ,
@@ -500,9 +501,10 @@ pub fn main() -> Result<(), anyhow::Error> {
500
501
compilation. validate ( ) ?;
501
502
let output = compilation. compile ( None ) ?;
502
503
504
+ let raw = version. is_some_and ( |s| s == "raw-id" ) ;
503
505
TranspileOutput {
504
- vertex : spirv_to_dis ( output. vertex ) ?,
505
- fragment : spirv_to_dis ( output. fragment ) ?,
506
+ vertex : spirv_to_dis ( output. vertex , raw ) ?,
507
+ fragment : spirv_to_dis ( output. fragment , raw ) ?,
506
508
}
507
509
}
508
510
} ;
@@ -649,13 +651,13 @@ fn set_params(
649
651
} ) ;
650
652
}
651
653
652
- fn spirv_to_dis ( spirv : Vec < u32 > ) -> anyhow:: Result < String > {
654
+ fn spirv_to_dis ( spirv : Vec < u32 > , raw : bool ) -> anyhow:: Result < String > {
653
655
let binary = spq_spvasm:: SpirvBinary :: from ( spirv) ;
654
656
spq_spvasm:: Disassembler :: new ( )
655
657
. print_header ( true )
656
- . name_ids ( true )
657
- . name_type_ids ( true )
658
- . name_const_ids ( true )
658
+ . name_ids ( !raw )
659
+ . name_type_ids ( !raw )
660
+ . name_const_ids ( !raw )
659
661
. indent ( true )
660
662
. disassemble ( & binary)
661
663
}
You can’t perform that action at this time.
0 commit comments