diff --git a/src/compute/managed/compu_buffer.rs b/src/compute/managed/compu_buffer.rs index 26cddc4a..f8020ef5 100644 --- a/src/compute/managed/compu_buffer.rs +++ b/src/compute/managed/compu_buffer.rs @@ -34,8 +34,9 @@ impl CompuBuffers { CpuAccessibleBuffer::from_iter(device.clone(), BufferUsage::all(), false, data_iter).unwrap() }; + let output_data = vec![0; data_length as usize]; let output_buffer = { - let mut buff = data.iter(); + let mut buff = output_data.iter(); let data_iter = (0..data_length).map(|n| *(buff.next().unwrap())); CpuAccessibleBuffer::from_iter(device.clone(), BufferUsage::all(), false, data_iter).unwrap() };