File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use crate :: cache_dir;
4
4
5
+ /// Show the computed source of the spirv-std dependency.
5
6
#[ derive( Clone , Debug , clap:: Parser ) ]
6
- pub struct ShowSpirvSource {
7
+ pub struct SpirvSourceDep {
7
8
/// The location of the shader-crate to inspect to determine its spirv-std dependency.
8
9
#[ clap( long, default_value = "./" ) ]
9
10
pub shader_crate : std:: path:: PathBuf ,
@@ -15,7 +16,7 @@ pub enum Info {
15
16
/// Displays the location of the cache directory
16
17
CacheDirectory ,
17
18
/// The source location of spirv-std
18
- SpirvSource ( ShowSpirvSource ) ,
19
+ SpirvSource ( SpirvSourceDep ) ,
19
20
}
20
21
21
22
/// `cargo gpu show`
@@ -34,7 +35,7 @@ impl Show {
34
35
Info :: CacheDirectory => {
35
36
println ! ( "{}" , cache_dir( ) . display( ) ) ;
36
37
}
37
- Info :: SpirvSource ( ShowSpirvSource { shader_crate } ) => {
38
+ Info :: SpirvSource ( SpirvSourceDep { shader_crate } ) => {
38
39
let rust_gpu_source =
39
40
crate :: spirv_source:: SpirvSource :: get_spirv_std_dep_definition ( & shader_crate) ;
40
41
println ! ( "{rust_gpu_source}" ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,12 @@ pub enum SpirvSource {
24
24
/// then the source of `rust-gpu` is `Git`.
25
25
///
26
26
/// `(String, String)` is the repo source and revision hash or tag.
27
- Git { url : String , rev : String } ,
27
+ Git {
28
+ /// URL of the repository
29
+ url : String ,
30
+ /// Revision or "commitsh"
31
+ rev : String ,
32
+ } ,
28
33
/// If the shader specifies a version like:
29
34
/// `spirv-std = { path = "/path/to/rust-gpu" ... }`
30
35
/// then the source of `rust-gpu` is `Path`.
@@ -40,9 +45,9 @@ impl core::fmt::Display for SpirvSource {
40
45
) ]
41
46
fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
42
47
match self {
43
- SpirvSource :: CratesIO ( version) => f. write_str ( version) ,
44
- SpirvSource :: Git { url, rev } => f. write_str ( & format ! ( "{url}+{rev}" ) ) ,
45
- SpirvSource :: Path ( ( a, b) ) => f. write_str ( & format ! ( "{a}+{b}" ) ) ,
48
+ Self :: CratesIO ( version) => f. write_str ( version) ,
49
+ Self :: Git { url, rev } => f. write_str ( & format ! ( "{url}+{rev}" ) ) ,
50
+ Self :: Path ( ( a, b) ) => f. write_str ( & format ! ( "{a}+{b}" ) ) ,
46
51
}
47
52
}
48
53
}
You can’t perform that action at this time.
0 commit comments