From 8ee2687cede2e7db2b719a6c04823468f4f309b9 Mon Sep 17 00:00:00 2001 From: saschawillems Date: Sat, 30 Apr 2016 10:45:39 +0200 Subject: [PATCH] Initializers for attachment descriptions --- base/vulkanexamplebase.cpp | 5 ++++- deferred/deferred.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 4562f38e..90f7996e 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -1386,7 +1386,9 @@ void VulkanExampleBase::setupFrameBuffer() void VulkanExampleBase::setupRenderPass() { - VkAttachmentDescription attachments[2]; + VkAttachmentDescription attachments[2] = {}; + + // Color attachment attachments[0].format = colorformat; attachments[0].samples = VK_SAMPLE_COUNT_1_BIT; attachments[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; @@ -1396,6 +1398,7 @@ void VulkanExampleBase::setupRenderPass() attachments[0].initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; attachments[0].finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; + // Depth attachment attachments[1].format = depthFormat; attachments[1].samples = VK_SAMPLE_COUNT_1_BIT; attachments[1].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR; diff --git a/deferred/deferred.cpp b/deferred/deferred.cpp index fc420e56..1ba16b0c 100644 --- a/deferred/deferred.cpp +++ b/deferred/deferred.cpp @@ -402,7 +402,7 @@ public: // Set up separate renderpass with references // to the color and depth attachments - std::array attachmentDescs; + std::array attachmentDescs = {}; // Init attachment properties for (uint32_t i = 0; i < 4; ++i)