diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 7c1437cf..9f05c4fb 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -581,21 +581,6 @@ void VulkanExampleBase::renderLoop() vkDeviceWaitIdle(device); } -VkSubmitInfo VulkanExampleBase::prepareSubmitInfo( - std::vector commandBuffers, - VkPipelineStageFlags *pipelineStages) -{ - VkSubmitInfo submitInfo = vkTools::initializers::submitInfo(); - submitInfo.pWaitDstStageMask = pipelineStages; - submitInfo.waitSemaphoreCount = 1; - submitInfo.pWaitSemaphores = &semaphores.presentComplete; - submitInfo.commandBufferCount = static_cast(commandBuffers.size()); - submitInfo.pCommandBuffers = commandBuffers.data(); - submitInfo.signalSemaphoreCount = 1; - submitInfo.pSignalSemaphores = &semaphores.renderComplete; - return submitInfo; -} - void VulkanExampleBase::updateTextOverlay() { if (!enableTextOverlay) diff --git a/base/vulkanexamplebase.h b/base/vulkanexamplebase.h index ed1760fd..26d7b254 100644 --- a/base/vulkanexamplebase.h +++ b/base/vulkanexamplebase.h @@ -108,8 +108,8 @@ protected: std::vector postPresentCmdBuffers = { VK_NULL_HANDLE }; // Command buffers for submitting a pre present image barrier std::vector prePresentCmdBuffers = { VK_NULL_HANDLE }; - // Pipeline stage flags for the submit info structure - VkPipelineStageFlags submitPipelineStages = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; + /** @brief Pipeline stages used to wait at for graphics queue submissions */ + VkPipelineStageFlags submitPipelineStages = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; // Contains command buffers and semaphores to be presented to the queue VkSubmitInfo submitInfo; // Command buffers used for rendering @@ -344,12 +344,6 @@ public: // Start the main render loop void renderLoop(); - // Prepare a submit info structure containing - // semaphores and submit buffer info for vkQueueSubmit - VkSubmitInfo prepareSubmitInfo( - std::vector commandBuffers, - VkPipelineStageFlags *pipelineStages); - void updateTextOverlay(); // Called when the text overlay is updating diff --git a/triangle/triangle.cpp b/triangle/triangle.cpp index 5e7a2d40..31ed2e18 100644 --- a/triangle/triangle.cpp +++ b/triangle/triangle.cpp @@ -333,11 +333,12 @@ public: // Get next image in the swap chain (back/front buffer) VK_CHECK_RESULT(swapChain.acquireNextImage(presentCompleteSemaphore, ¤tBuffer)); + // Pipeline stage at which the queue submission will wait (via pWaitSemaphores) + VkPipelineStageFlags waitStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT; // The submit info structure specifices a command buffer queue submission batch - VkPipelineStageFlags pipelineStages = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; VkSubmitInfo submitInfo = {}; submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; - submitInfo.pWaitDstStageMask = &pipelineStages; + submitInfo.pWaitDstStageMask = &waitStageMask; // Pointer to the list of pipeline stages that the semaphore waits will occur at submitInfo.pWaitSemaphores = &presentCompleteSemaphore; // Semaphore(s) to wait upon before the submitted command buffer starts executing submitInfo.waitSemaphoreCount = 1; // One wait semaphore submitInfo.pSignalSemaphores = &renderCompleteSemaphore; // Semaphore(s) to be signaled when command buffers have completed