@@ -216,7 +216,8 @@ fn maybe_watch(
216216#[ command( ) ]
217217pub struct Options {
218218 /// which shader to run
219- #[ arg( short, long, default_value = "sky" ) ]
219+ #[ cfg_attr( not( target_arch = "wasm32" ) , arg( short, long, default_value = "sky" ) ) ]
220+ #[ cfg_attr( target_arch = "wasm32" , arg( short, long, default_value = "mouse" ) ) ]
220221 shader : RustGPUShader ,
221222
222223 #[ arg( long) ]
@@ -230,22 +231,24 @@ pub struct Options {
230231pub fn main (
231232 #[ cfg( target_os = "android" ) ] android_app : winit:: platform:: android:: activity:: AndroidApp ,
232233) {
233- // Hack: spirv_builder builds into a custom directory if running under cargo, to not
234- // deadlock, and the default target directory if not. However, packages like `proc-macro2`
235- // have different configurations when being built here vs. when building
236- // rustc_codegen_spirv normally, so we *want* to build into a separate target directory, to
237- // not have to rebuild half the crate graph every time we run. So, pretend we're running
238- // under cargo by setting these environment variables.
239- unsafe {
240- std:: env:: set_var ( "OUT_DIR" , env ! ( "OUT_DIR" ) ) ;
241- std:: env:: set_var ( "PROFILE" , env ! ( "PROFILE" ) ) ;
242- }
243-
244234 let mut options = Options :: parse ( ) ;
245235
246236 #[ cfg( not( any( target_os = "android" , target_arch = "wasm32" ) ) ) ]
247- if options. shader == RustGPUShader :: Compute {
248- return compute:: start ( & options) ;
237+ {
238+ // Hack: spirv_builder builds into a custom directory if running under cargo, to not
239+ // deadlock, and the default target directory if not. However, packages like `proc-macro2`
240+ // have different configurations when being built here vs. when building
241+ // rustc_codegen_spirv normally, so we *want* to build into a separate target directory, to
242+ // not have to rebuild half the crate graph every time we run. So, pretend we're running
243+ // under cargo by setting these environment variables.
244+ unsafe {
245+ std:: env:: set_var ( "OUT_DIR" , env ! ( "OUT_DIR" ) ) ;
246+ std:: env:: set_var ( "PROFILE" , env ! ( "PROFILE" ) ) ;
247+ }
248+
249+ if options. shader == RustGPUShader :: Compute {
250+ return compute:: start ( & options) ;
251+ }
249252 }
250253
251254 // HACK(eddyb) force push constant emulation using (read-only) SSBOs, on
0 commit comments