protected virtual void Draw(Timer timer) { // Acquire an index of drawing image for this frame. int imageIndex = Swapchain.AcquireNextImage(semaphore: ImageAvailableSemaphore); // Submit recorded commands to graphics queue for execution. Context.GraphicsQueue.Submit( ImageAvailableSemaphore, PipelineStages.ColorAttachmentOutput, CommandBuffers[imageIndex], RenderingFinishedSemaphore ); // Present the color output to screen. Context.PresentQueue.PresentKhr(RenderingFinishedSemaphore, Swapchain, imageIndex); }
private void DrawFrame() { uint nextImage = swapChain.AcquireNextImage(uint.MaxValue, imageAvailableSemaphore, null); graphicsQueue.Submit( new SubmitInfo { CommandBuffers = new[] { commandBuffers[nextImage] }, SignalSemaphores = new[] { renderFinishedSemaphore }, WaitDestinationStageMask = new[] { PipelineStageFlags.ColorAttachmentOutput }, WaitSemaphores = new[] { imageAvailableSemaphore } }, null ); presentQueue.Present(renderFinishedSemaphore, swapChain, nextImage, new Result[1]); }
protected override void Draw(Timer timer) { // Acquire an index of drawing image for this frame. int imageIndex = Swapchain.AcquireNextImage(semaphore: ImageAvailableSemaphore); // Use a fence to wait until the command buffer has finished execution before using it again SubmitFences[imageIndex].Wait(); SubmitFences[imageIndex].Reset(); // Submit recorded commands to graphics queue for execution. Context.GraphicsQueue.Submit( ImageAvailableSemaphore, PipelineStages.Transfer, CommandBuffers[imageIndex], RenderingFinishedSemaphore, SubmitFences[imageIndex] ); // Present the color output to screen. Context.PresentQueue.PresentKhr(RenderingFinishedSemaphore, Swapchain, imageIndex); }
protected void prepareFrame() { // Acquire the next image from the swap chaing Util.CheckResult(Swapchain.AcquireNextImage(semaphores[0].PresentComplete, ref currentBuffer)); }
/// <summary> /// Acqure a new swapchain image and signal ImageAvailableSemaphore when done /// </summary> /// <returns></returns> public int NextSwapchainImage() { return(Swapchain.AcquireNextImage(semaphore: ImageAvailableSemaphore)); }
protected void prepareFrame() { // Acquire the next image from the swap chaing Swapchain.AcquireNextImage(((Semaphores *)semaphores.header)[0].PresentComplete, ref currentBuffer); }