static unsafe void InvalidateInternal(Device device, int count, VkMappedMemoryRange *ranges) { var result = device.Commands.invalidateMemory(device.Native, (uint)count, (IntPtr)ranges); if (result != VkResult.Success) { throw new DeviceMemoryException(string.Format("Error invalidating memory: {0}", result)); } }
static void InvalidateInternal(Device device, int count, MappedMemoryRange[] ranges) { unsafe { VkMappedMemoryRange *rangesNative = stackalloc VkMappedMemoryRange[count]; for (int i = 0; i < count; i++) { rangesNative[i] = Marshal(ranges[i]); } InvalidateInternal(device, count, rangesNative); } }
internal extern static unsafe Result vkInvalidateMappedMemoryRanges(IntPtr device, UInt32 memoryRangeCount, VkMappedMemoryRange *pMemoryRanges);