@@ -10,11 +10,11 @@ use context::WgpuContext;
1010use lazy_regex:: regex;
1111use num:: Integer ;
1212use pp:: { SourceMap , WGSLError } ;
13- use wgpu:: { Maintain , SubmissionIndex } ;
1413use std:: collections:: HashMap ;
1514use std:: mem:: { size_of, take} ;
1615use std:: sync:: atomic:: { AtomicBool , Ordering } ;
1716use wasm_bindgen:: prelude:: * ;
17+ use wgpu:: { Maintain , SubmissionIndex } ;
1818
1919// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
2020// allocator.
@@ -198,7 +198,18 @@ impl WgpuToyRenderer {
198198 }
199199 }
200200
201- pub fn render_to ( & mut self , frame : & wgpu:: SurfaceTexture ) -> ( Option < wgpu:: Buffer > , SubmissionIndex ) {
201+ #[ cfg( not( target_arch = "wasm32" ) ) ]
202+ pub fn render_to_surface (
203+ & mut self ,
204+ frame : & wgpu:: SurfaceTexture ,
205+ ) -> ( Option < wgpu:: Buffer > , SubmissionIndex ) {
206+ self . render_to ( frame)
207+ }
208+
209+ fn render_to (
210+ & mut self ,
211+ frame : & wgpu:: SurfaceTexture ,
212+ ) -> ( Option < wgpu:: Buffer > , SubmissionIndex ) {
202213 let mut encoder = self . wgpu . device . create_command_encoder ( & Default :: default ( ) ) ;
203214 self . bindings . stage ( & self . wgpu . queue ) ;
204215 if self . bindings . time . host . frame % STATS_PERIOD == 0 {
0 commit comments