#'Compute Task Pool (0)' panicked at 'Buffer Valid((0, 1, Vulkan)) is still mapped'
5 messages · Page 1 of 1 (latest)
let mut encoder = render_device.create_command_encoder(&CommandEncoderDescriptor {
label: Some("marching cube command encoder")
});
{
let mut encoder_pass = encoder.begin_compute_pass(&ComputePassDescriptor {
label: Some("marching cube compute pass"),
});
// -- Dispatch the compute shader
encoder_pass.set_pipeline(&pipeline.pipeline);
encoder_pass.set_bind_group(0, &binding_groups, &[]);
encoder_pass.dispatch_workgroups(8,8,1);
}
let command_buffer = encoder.finish();
render_queue.submit([command_buffer]);
let slice = buffers.vertex.slice(..);
slice.map_async(MapMode::Read, move |result| {
let err = result.err();
if err.is_some() {
panic!("{}", err.unwrap().to_string());
}
});
let data = slice.get_mapped_range();
let result = Vec::from(data.deref());
drop(data);
Feel free to tag me if you are interested in helping, any help would be greatly appreciated
maybe only one of get_mapped_range or map_async is needed (https://docs.rs/wgpu/latest/wgpu/struct.BufferSlice.html), not sure