From 68bf10a3a5c439728825d4f3bd2d2ec075421edc Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Sun, 6 Sep 2020 20:37:03 -0400 Subject: [PATCH] Fix invalidated segment of the staging memory --- wgpu-core/src/device/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index d0c8d0f399..fb3d908116 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -3702,13 +3702,14 @@ impl Global { let _ = ptr; if needs_flush { - let segment = hal::memory::Segment::default(); + //TODO: gfx-memory needs a helper method for this. + // It needs to align the mapped range to the non-coherent atom size. unsafe { device .raw .flush_mapped_memory_ranges(iter::once(( stage_memory.memory(), - segment, + stage_memory.segment(), ))) .unwrap() };