From 19e108165c272c73fcfc9008de99c44cc253142b Mon Sep 17 00:00:00 2001 From: saschawillems Date: Tue, 17 May 2016 23:26:08 +0200 Subject: [PATCH] Reset wait stage masks for submit info after submitting text overlay, disable depth writes and reads , optimize load and store ops for attachments --- base/vulkanexamplebase.cpp | 2 ++ base/vulkantextoverlay.hpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index c3febaa7..abf07cd4 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -696,6 +696,8 @@ void VulkanExampleBase::submitFrame() submitInfo.pCommandBuffers = &textOverlay->cmdBuffers[currentBuffer]; VK_CHECK_RESULT(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; diff --git a/base/vulkantextoverlay.hpp b/base/vulkantextoverlay.hpp index 17247913..f3485e19 100644 --- a/base/vulkantextoverlay.hpp +++ b/base/vulkantextoverlay.hpp @@ -415,8 +415,8 @@ public: VkPipelineDepthStencilStateCreateInfo depthStencilState = vkTools::initializers::pipelineDepthStencilStateCreateInfo( - VK_TRUE, - VK_TRUE, + VK_FALSE, + VK_FALSE, VK_COMPARE_OP_LESS_OR_EQUAL); VkPipelineViewportStateCreateInfo viewportState = @@ -493,8 +493,8 @@ public: // Depth attachment attachments[1].format = depthFormat; attachments[1].samples = VK_SAMPLE_COUNT_1_BIT; - attachments[1].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; - attachments[1].storeOp = VK_ATTACHMENT_STORE_OP_STORE; + attachments[1].loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; + attachments[1].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; attachments[1].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; attachments[1].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE; attachments[1].initialLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;