From b2b4942a59a2fcd97c2f98f5941261a493ad9219 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Fri, 30 Jun 2023 15:06:57 +0100 Subject: [PATCH] Only request required part of feedback buffer rather than full range --- src/voxel/brickmap.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/voxel/brickmap.rs b/src/voxel/brickmap.rs index 1047422..1840ba3 100644 --- a/src/voxel/brickmap.rs +++ b/src/voxel/brickmap.rs @@ -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();