From 3d5fd5ccada5efcc976ab0023c2633f860364cec Mon Sep 17 00:00:00 2001 From: msiglreith Date: Tue, 17 Apr 2018 19:37:15 +0200 Subject: [PATCH] Handle WHOLE_SIZE for memory mapping --- libportability-gfx/src/impls.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libportability-gfx/src/impls.rs b/libportability-gfx/src/impls.rs index 09880a2..f18021b 100644 --- a/libportability-gfx/src/impls.rs +++ b/libportability-gfx/src/impls.rs @@ -793,13 +793,15 @@ pub extern "C" fn gfxMapMemory( _flags: VkMemoryMapFlags, ppData: *mut *mut ::std::os::raw::c_void, ) -> VkResult { - if size == VK_WHOLE_SIZE as VkDeviceSize { - unimplemented!() - } + let range = if size == VK_WHOLE_SIZE as VkDeviceSize { + (Some(offset), None) + } else { + (Some(offset), Some(offset + size)) + }; unsafe { *ppData = gpu.device - .map_memory(&memory, offset..offset + size) + .map_memory(&memory, range) .unwrap() as *mut _; // TODO }