Handle WHOLE_SIZE for memory mapping

This commit is contained in:
msiglreith 2018-04-17 19:37:15 +02:00
parent 1d299a4949
commit 3d5fd5ccad

View file

@ -793,13 +793,15 @@ pub extern "C" fn gfxMapMemory(
_flags: VkMemoryMapFlags, _flags: VkMemoryMapFlags,
ppData: *mut *mut ::std::os::raw::c_void, ppData: *mut *mut ::std::os::raw::c_void,
) -> VkResult { ) -> VkResult {
if size == VK_WHOLE_SIZE as VkDeviceSize { let range = if size == VK_WHOLE_SIZE as VkDeviceSize {
unimplemented!() (Some(offset), None)
} } else {
(Some(offset), Some(offset + size))
};
unsafe { unsafe {
*ppData = gpu.device *ppData = gpu.device
.map_memory(&memory, offset..offset + size) .map_memory(&memory, range)
.unwrap() as *mut _; // TODO .unwrap() as *mut _; // TODO
} }