/// <summary> /// /// </summary> internal unsafe void MarshalTo(SharpVk.Interop.Khronos.SemaphoreGetWin32HandleInfo *pointer) { pointer->SType = StructureType.SemaphoreGetWin32HandleInfo; pointer->Next = null; pointer->Semaphore = this.Semaphore?.handle ?? default(SharpVk.Interop.Semaphore); pointer->HandleType = this.HandleType; }
/// <summary> /// /// </summary> public static unsafe IntPtr GetSemaphoreWin32Handle(this SharpVk.Device extendedHandle, SharpVk.Khronos.SemaphoreGetWin32HandleInfo getWin32HandleInfo) { try { IntPtr result = default(IntPtr); CommandCache commandCache = default(CommandCache); SharpVk.Interop.Khronos.SemaphoreGetWin32HandleInfo *marshalledGetWin32HandleInfo = default(SharpVk.Interop.Khronos.SemaphoreGetWin32HandleInfo *); IntPtr marshalledHandle = default(IntPtr); commandCache = extendedHandle.commandCache; marshalledGetWin32HandleInfo = (SharpVk.Interop.Khronos.SemaphoreGetWin32HandleInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.SemaphoreGetWin32HandleInfo>()); getWin32HandleInfo.MarshalTo(marshalledGetWin32HandleInfo); SharpVk.Interop.Khronos.VkDeviceGetSemaphoreWin32HandleDelegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.VkDeviceGetSemaphoreWin32HandleDelegate>("vkGetSemaphoreWin32HandleKHR", "instance"); Result methodResult = commandDelegate(extendedHandle.handle, marshalledGetWin32HandleInfo, &marshalledHandle); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } result = marshalledHandle; return(result); } finally { Interop.HeapUtil.FreeAll(); } }