@@ -79,6 +79,8 @@ use winit::{
79
79
event_loop:: { ControlFlow , EventLoop } ,
80
80
} ;
81
81
82
+ use clap:: Parser ;
83
+ use std:: error:: Error ;
82
84
use std:: {
83
85
borrow:: Cow ,
84
86
collections:: HashMap ,
@@ -89,8 +91,6 @@ use std::{
89
91
thread,
90
92
} ;
91
93
92
- use clap:: Parser ;
93
-
94
94
use spirv_builder:: { MetadataPrintout , SpirvBuilder } ;
95
95
96
96
use shared:: ShaderConstants ;
@@ -235,7 +235,7 @@ pub fn main() {
235
235
. unwrap ( ) ;
236
236
}
237
237
238
- pub fn compile_shaders ( ) -> Vec < SpvFile > {
238
+ pub fn compile_shaders ( ) -> Result < Vec < SpvFile > , Box < dyn Error > > {
239
239
// Hack: spirv_builder builds into a custom directory if running under cargo, to not
240
240
// deadlock, and the default target directory if not. However, packages like `proc-macro2`
241
241
// have different configurations when being built here vs. when building
@@ -248,7 +248,7 @@ pub fn compile_shaders() -> Vec<SpvFile> {
248
248
SpirvBuilder :: new (
249
249
concat ! ( env!( "CARGO_MANIFEST_DIR" ) , "/../../shaders/sky-shader" ) ,
250
250
"spirv-unknown-vulkan1.1" ,
251
- )
251
+ ) ?
252
252
. print_metadata ( MetadataPrintout :: None )
253
253
. shader_panic_strategy ( spirv_builder:: ShaderPanicStrategy :: DebugPrintfThenExit {
254
254
print_inputs : true ,
@@ -257,8 +257,7 @@ pub fn compile_shaders() -> Vec<SpvFile> {
257
257
// HACK(eddyb) needed because of `debugPrintf` instrumentation limitations
258
258
// (see https://github.com/KhronosGroup/SPIRV-Tools/issues/4892).
259
259
. multimodule ( true )
260
- . build ( )
261
- . unwrap ( )
260
+ . build ( ) ?
262
261
. module
263
262
. unwrap_multi ( )
264
263
. iter ( )
0 commit comments