@@ -61,7 +61,7 @@ fn shader_module(shader: RustGPUShader) -> wgpu::ShaderModuleDescriptor<'static>
61
61
{
62
62
use spirv_builder:: SpirvBuilder ;
63
63
use std:: borrow:: Cow ;
64
- use std:: path:: { Path , PathBuf } ;
64
+ use std:: path:: PathBuf ;
65
65
// Hack: spirv_builder builds into a custom directory if running under cargo, to not
66
66
// deadlock, and the default target directory if not. However, packages like `proc-macro2`
67
67
// have different configurations when being built here vs. when building
@@ -76,26 +76,12 @@ fn shader_module(shader: RustGPUShader) -> wgpu::ShaderModuleDescriptor<'static>
76
76
RustGPUShader :: Compute => "compute-shader" ,
77
77
RustGPUShader :: Mouse => "mouse-shader" ,
78
78
} ;
79
- let target = match shader {
80
- RustGPUShader :: Simplest | RustGPUShader :: Mouse | RustGPUShader :: Sky => {
81
- "spirv-unknown-vulkan1.0"
82
- }
83
- // The compute example uses a StorageBuffer, so needs Vulkan 1.1 which supports
84
- // that natively
85
- RustGPUShader :: Compute => "spirv-unknown-vulkan1.1" ,
86
- } ;
87
79
let manifest_dir = env ! ( "CARGO_MANIFEST_DIR" ) ;
88
- let crate_path = [
89
- Path :: new ( manifest_dir) ,
90
- Path :: new ( ".." ) ,
91
- Path :: new ( ".." ) ,
92
- Path :: new ( "shaders" ) ,
93
- Path :: new ( crate_name) ,
94
- ]
95
- . iter ( )
96
- . copied ( )
97
- . collect :: < PathBuf > ( ) ;
98
- let result = SpirvBuilder :: new ( crate_path, target)
80
+ let crate_path = [ manifest_dir, ".." , ".." , "shaders" , crate_name]
81
+ . iter ( )
82
+ . copied ( )
83
+ . collect :: < PathBuf > ( ) ;
84
+ let result = SpirvBuilder :: new ( crate_path, "spirv-unknown-vulkan1.1" )
99
85
. print_metadata ( false )
100
86
. build ( )
101
87
. unwrap ( ) ;
0 commit comments