/// <summary> /// /// </summary> public static unsafe SharpVk.Fence RegisterEvent(this SharpVk.Device extendedHandle, SharpVk.Multivendor.DeviceEventInfo deviceEventInfo, SharpVk.AllocationCallbacks allocator) { try { SharpVk.Fence result = default(SharpVk.Fence); CommandCache commandCache = default(CommandCache); SharpVk.Interop.Multivendor.DeviceEventInfo *marshalledDeviceEventInfo = default(SharpVk.Interop.Multivendor.DeviceEventInfo *); SharpVk.Interop.AllocationCallbacks * marshalledAllocator = default(SharpVk.Interop.AllocationCallbacks *); SharpVk.Interop.Fence marshalledFence = default(SharpVk.Interop.Fence); commandCache = extendedHandle.commandCache; marshalledDeviceEventInfo = (SharpVk.Interop.Multivendor.DeviceEventInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Multivendor.DeviceEventInfo>()); deviceEventInfo.MarshalTo(marshalledDeviceEventInfo); marshalledAllocator = (SharpVk.Interop.AllocationCallbacks *)(Interop.HeapUtil.Allocate <SharpVk.Interop.AllocationCallbacks>()); allocator.MarshalTo(marshalledAllocator); SharpVk.Interop.Multivendor.VkDeviceRegisterEventDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Multivendor.VkDeviceRegisterEventDelegate>("vkRegisterDeviceEventEXT", "instance"); Result methodResult = commandDelegate(extendedHandle.handle, marshalledDeviceEventInfo, marshalledAllocator, &marshalledFence); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } result = new SharpVk.Fence(extendedHandle, marshalledFence); return(result); } finally { Interop.HeapUtil.FreeAll(); } }
/// <summary> /// /// </summary> internal unsafe void MarshalTo(SharpVk.Interop.Multivendor.DeviceEventInfo *pointer) { pointer->SType = StructureType.DeviceEventInfo; pointer->Next = null; pointer->DeviceEvent = this.DeviceEvent; }