Example #1
0
        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);
        }
Example #2
0
        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]);
        }
Example #3
0
        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);
        }
Example #4
0
 protected void prepareFrame()
 {
     // Acquire the next image from the swap chaing
     Util.CheckResult(Swapchain.AcquireNextImage(semaphores[0].PresentComplete, ref currentBuffer));
 }
Example #5
0
 /// <summary>
 /// Acqure a new swapchain image and signal ImageAvailableSemaphore when done
 /// </summary>
 /// <returns></returns>
 public int NextSwapchainImage()
 {
     return(Swapchain.AcquireNextImage(semaphore: ImageAvailableSemaphore));
 }
Example #6
0
 protected void prepareFrame()
 {
     // Acquire the next image from the swap chaing
     Swapchain.AcquireNextImage(((Semaphores *)semaphores.header)[0].PresentComplete, ref currentBuffer);
 }