@@ -79,6 +79,8 @@ use winit::{
7979 event_loop:: { ControlFlow , EventLoop } ,
8080} ;
8181
82+ use clap:: Parser ;
83+ use std:: error:: Error ;
8284use std:: {
8385 borrow:: Cow ,
8486 collections:: HashMap ,
@@ -89,8 +91,6 @@ use std::{
8991 thread,
9092} ;
9193
92- use clap:: Parser ;
93-
9494use spirv_builder:: { MetadataPrintout , SpirvBuilder } ;
9595
9696use shared:: ShaderConstants ;
@@ -235,7 +235,7 @@ pub fn main() {
235235 . unwrap ( ) ;
236236}
237237
238- pub fn compile_shaders ( ) -> Vec < SpvFile > {
238+ pub fn compile_shaders ( ) -> Result < Vec < SpvFile > , Box < dyn Error > > {
239239 // Hack: spirv_builder builds into a custom directory if running under cargo, to not
240240 // deadlock, and the default target directory if not. However, packages like `proc-macro2`
241241 // have different configurations when being built here vs. when building
@@ -248,7 +248,7 @@ pub fn compile_shaders() -> Vec<SpvFile> {
248248 SpirvBuilder :: new (
249249 concat ! ( env!( "CARGO_MANIFEST_DIR" ) , "/../../shaders/sky-shader" ) ,
250250 "spirv-unknown-vulkan1.1" ,
251- )
251+ ) ?
252252 . print_metadata ( MetadataPrintout :: None )
253253 . shader_panic_strategy ( spirv_builder:: ShaderPanicStrategy :: DebugPrintfThenExit {
254254 print_inputs : true ,
@@ -257,8 +257,7 @@ pub fn compile_shaders() -> Vec<SpvFile> {
257257 // HACK(eddyb) needed because of `debugPrintf` instrumentation limitations
258258 // (see https://github.com/KhronosGroup/SPIRV-Tools/issues/4892).
259259 . multimodule ( true )
260- . build ( )
261- . unwrap ( )
260+ . build ( ) ?
262261 . module
263262 . unwrap_multi ( )
264263 . iter ( )
0 commit comments