Skip to content

Rendering texture to file raises exits with (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN) #4669

Closed Answered by Maypher
Maypher asked this question in Q&A
Discussion options

You must be logged in to vote

After a bit of messing around with the code I discovered that the issue comes from the last line, output_buffer.unmap(). It raised the error You cannot unmap a buffer that still has accessible mapped views but since I was using cargo test to execute it it didn't show outputs. As it turns out there can't be any BufferViews alive when unmap() is called so the solution was to put this code in its own scope.

{
      let output_buffer_slice = output_buffer.slice(..);
  
      output_buffer_slice.map_async(wgpu::MapMode::Read, |_| {});
  
      self.device.poll(wgpu::Maintain::Wait);
  
      let data = output_buffer_slice.get_mapped_range();
  
      
      use image::{ImageBuffer, Rgba};
      

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Maypher
Comment options

Comment options

You must be logged in to vote
1 reply
@Maypher
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Maypher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants