/// <summary> /// Map a memory object into application address space. /// </summary> /// <param name="offset"> /// </param> /// <param name="size"> /// </param> /// <param name="flags"> /// </param> public unsafe IntPtr Map(ulong offset, ulong size, SharpVk.MemoryMapFlags?flags = default(SharpVk.MemoryMapFlags?)) { try { IntPtr result = default(IntPtr); SharpVk.MemoryMapFlags marshalledFlags = default(SharpVk.MemoryMapFlags); void *marshalledData = default(void *); if (flags != null) { marshalledFlags = flags.Value; } else { marshalledFlags = default(SharpVk.MemoryMapFlags); } SharpVk.Interop.VkDeviceMemoryMapDelegate commandDelegate = commandCache.Cache.vkMapMemory; Result methodResult = commandDelegate(this.parent.handle, this.handle, offset, size, marshalledFlags, &marshalledData); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } result = new IntPtr(marshalledData); return(result); } finally { Interop.HeapUtil.FreeAll(); } }
/// <summary> /// Map a memory object into application address space. /// </summary> public unsafe IntPtr Map(DeviceSize offset, DeviceSize size, SharpVk.MemoryMapFlags?flags = default(SharpVk.MemoryMapFlags?)) { try { IntPtr result = default(IntPtr); SharpVk.MemoryMapFlags marshalledFlags = default(SharpVk.MemoryMapFlags); void *marshalledData = default(void *); if (flags != null) { marshalledFlags = flags.Value; } else { marshalledFlags = default(SharpVk.MemoryMapFlags); } Result methodResult = Interop.Commands.vkMapMemory(this.parent.handle, this.handle, offset, size, marshalledFlags, &marshalledData); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } result = new IntPtr(marshalledData); return(result); } finally { Interop.HeapUtil.FreeAll(); } }
public static extern SharpVk.Result vkMapMemory(SharpVk.Interop.Device device, SharpVk.Interop.DeviceMemory memory, DeviceSize offset, DeviceSize size, SharpVk.MemoryMapFlags flags, void **data);