/// <summary> /// Retrieve the index of the next available presentable image. /// </summary> /// <param name="extendedHandle"> /// The Device handle to extend. /// </param> public static unsafe uint AcquireNextImage2(this SharpVk.Device extendedHandle, SharpVk.Khronos.AcquireNextImageInfo acquireInfo) { try { uint result = default(uint); CommandCache commandCache = default(CommandCache); SharpVk.Interop.Khronos.AcquireNextImageInfo *marshalledAcquireInfo = default(SharpVk.Interop.Khronos.AcquireNextImageInfo *); uint marshalledImageIndex = default(uint); commandCache = extendedHandle.commandCache; marshalledAcquireInfo = (SharpVk.Interop.Khronos.AcquireNextImageInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.AcquireNextImageInfo>()); acquireInfo.MarshalTo(marshalledAcquireInfo); SharpVk.Interop.Khronos.VkDeviceAcquireNextImage2Delegate commandDelegate = commandCache.Cache.vkAcquireNextImage2KHR; Result methodResult = commandDelegate(extendedHandle.handle, marshalledAcquireInfo, &marshalledImageIndex); if (SharpVkException.IsError(methodResult)) { throw SharpVkException.Create(methodResult); } result = marshalledImageIndex; return(result); } finally { Interop.HeapUtil.FreeAll(); } }
/// <summary> /// /// </summary> /// <param name="pointer"> /// </param> internal unsafe void MarshalTo(SharpVk.Interop.Khronos.AcquireNextImageInfo *pointer) { pointer->SType = StructureType.AcquireNextImageInfo; pointer->Next = null; pointer->Swapchain = this.Swapchain?.handle ?? default(SharpVk.Interop.Khronos.Swapchain); pointer->Timeout = this.Timeout; pointer->Semaphore = this.Semaphore?.handle ?? default(SharpVk.Interop.Semaphore); pointer->Fence = this.Fence?.handle ?? default(SharpVk.Interop.Fence); pointer->DeviceMask = this.DeviceMask; }