mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 22:41:07 +01:00
Fix capture example panic in the browser (#4043)
This commit is contained in:
1 parent
014ae3fe43
commit
cda3f21652
1 file changed
+5
-5
@@ -148,13 +148,13 @@ async fn create_png(
|
||||
//
|
||||
// We pass our submission index so we don't need to wait for any other possible submissions.
|
||||
device.poll(wgpu::Maintain::WaitForSubmissionIndex(submission_index));
|
||||
// If a file system is available, write the buffer as a PNG
|
||||
let has_file_system_available = cfg!(not(target_arch = "wasm32"));
|
||||
if !has_file_system_available {
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(Ok(())) = receiver.receive().await {
|
||||
// If a file system is available, write the buffer as a PNG
|
||||
let has_file_system_available = cfg!(not(target_arch = "wasm32"));
|
||||
if !has_file_system_available {
|
||||
return;
|
||||
}
|
||||
let padded_buffer = buffer_slice.get_mapped_range();
|
||||
|
||||
let mut png_encoder = png::Encoder::new(
|
||||
|
||||
Reference in new issue
Block a user