public Result AcquireNextImageKHR(IMgSwapchainKHR swapchain, ulong timeout, IMgSemaphore semaphore, IMgFence fence, out uint pImageIndex) { if (swapchain == null) { throw new ArgumentNullException(nameof(swapchain)); } // TODO : make it variable var bSwapchain = (AmtSwapchainKHR)swapchain; var nextIndex = bSwapchain.GetAvailableImageIndex(); if (timeout == ulong.MaxValue) { bSwapchain.Images[nextIndex].Inflight.WaitOne(); } else { var ticks = (long)timeout / 10000L; var timespan = TimeSpan.FromTicks(ticks); bSwapchain.Images[nextIndex].Inflight.WaitOne(timespan); } bSwapchain.RefreshImageView(nextIndex); pImageIndex = nextIndex; return(Result.SUCCESS); }
//public IMgCommandBuffer PostPresent { get; set; } //public IMgCommandBuffer PrePresent { get; set; } uint AcquireNextImage(IMgSemaphore presentComplete, ulong timeout) { uint nextImage; Result err = mGraphicsConfiguration.Device.AcquireNextImageKHR(mCollection.Swapchain, timeout, presentComplete, null, out nextImage); Debug.Assert(err == Result.SUCCESS); return(nextImage); }
public uint BeginDraw(IMgCommandBuffer postPresent, IMgSemaphore presentComplete, ulong timeout) { var currentIndex = 0U; mLayers[currentIndex].Inflight.WaitOne(); if (mLayers[currentIndex].Drawable != null) { mLayers[currentIndex].Drawable.Dispose(); } mLayers[currentIndex].Drawable = mView.CurrentDrawable; return(currentIndex); }
public Result AcquireNextImageKHR(IMgSwapchainKHR swapchain, ulong timeout, IMgSemaphore semaphore, IMgFence fence, out uint pImageIndex) { if (swapchain == null) { throw new ArgumentNullException("swapchain"); } var sc = swapchain as IGLSwapchainKHR; if (sc == null) { throw new InvalidCastException("swapchain is not GLSwapchainKHR"); } pImageIndex = sc.GetNextImage(); // TODO : fence stuff return(Result.SUCCESS); }
public uint BeginDraw(IMgCommandBuffer postPresent, IMgSemaphore presentComplete, ulong timeout) { // Get next image in the swap chain (back/front buffer) //err = swapChain.acquireNextImage(semaphores.presentComplete, ¤tBuffer); var nextImage = AcquireNextImage(presentComplete, timeout); var currentBuffer = mCollection.Buffers [nextImage]; mBarrier.SubmitPostPresentBarrier(postPresent, currentBuffer.Image); var submitInfo = new[] { new MgSubmitInfo { CommandBuffers = new [] { postPresent }, } }; var result = mGraphicsConfiguration.Queue.QueueSubmit(submitInfo, null); Debug.Assert(result == Result.SUCCESS, result + " != Result.SUCCESS"); return(nextImage); }
public Result CreateSemaphore(MgSemaphoreCreateInfo pCreateInfo, IMgAllocationCallbacks allocator, out IMgSemaphore pSemaphore) { throw new NotImplementedException(); }
public uint BeginDraw(IMgCommandBuffer postPresent, IMgSemaphore presentComplete) { return(BeginDraw(postPresent, presentComplete, ulong.MaxValue)); }
public Result AcquireNextImageKHR(IMgSwapchainKHR swapchain, ulong timeout, IMgSemaphore semaphore, IMgFence fence, out uint pImageIndex) { throw new NotImplementedException(); }
public Result CreateSemaphore(MgSemaphoreCreateInfo pCreateInfo, IMgAllocationCallbacks allocator, out IMgSemaphore pSemaphore) { pSemaphore = mEntrypoint.Semaphore.CreateSemaphore(); return(Result.SUCCESS); }
public IMgSemaphore[] Render(IMgQueue queue, uint layerNo, IMgSemaphore semaphore) { return(new IMgSemaphore[] { }); }