Ejemplo n.º 1
0
        protected void submitFrame()
        {
            bool submitTextOverlay = false;

            /*
             * if (submitTextOverlay)
             * {
             *  // Wait for color attachment output to finish before rendering the text overlay
             *  VkPipelineStageFlags stageFlags = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
             *  submitInfo.pWaitDstStageMask = &stageFlags;
             *
             *  // Set semaphores
             *  // Wait for render complete semaphore
             *  submitInfo.waitSemaphoreCount = 1;
             *  submitInfo.pWaitSemaphores = &semaphores.renderComplete;
             *  // Signal ready with text overlay complete semaphpre
             *  submitInfo.signalSemaphoreCount = 1;
             *  submitInfo.pSignalSemaphores = &semaphores.textOverlayComplete;
             *
             *  // Submit current text overlay command buffer
             *  submitInfo.commandBufferCount = 1;
             *  submitInfo.pCommandBuffers = &textOverlay->cmdBuffers[currentBuffer];
             *  Util.CheckResult(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
             *
             *  // Reset stage mask
             *  submitInfo.pWaitDstStageMask = &submitPipelineStages;
             *  // Reset wait and signal semaphores for rendering next frame
             *  // Wait for swap chain presentation to finish
             *  submitInfo.waitSemaphoreCount = 1;
             *  submitInfo.pWaitSemaphores = &semaphores.presentComplete;
             *  // Signal ready with offscreen semaphore
             *  submitInfo.signalSemaphoreCount = 1;
             *  submitInfo.pSignalSemaphores = &semaphores.renderComplete;
             * }
             */

            Util.CheckResult(Swapchain.QueuePresent(queue, currentBuffer, submitTextOverlay ? semaphores[0].TextOverlayComplete : semaphores[0].RenderComplete));

            Util.CheckResult(vkQueueWaitIdle(queue));
        }