Only request required part of feedback buffer rather than full range

This commit is contained in:
Jarrod Doyle 2023-06-30 15:06:57 +01:00
parent b163fa0177
commit b2b4942a59
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 2 additions and 1 deletions

View File

@ -159,7 +159,8 @@ impl BrickmapManager {
}
// Get the position data
slice = self.feedback_result_buffer.slice(16..);
let range_end = 16 + 16 * request_count as u64;
slice = self.feedback_result_buffer.slice(16..range_end);
slice.map_async(wgpu::MapMode::Read, |_| {});
context.device.poll(wgpu::Maintain::Wait);
data = bytemuck::cast_slice(slice.get_mapped_range().as_ref()).to_vec();