From e9270580b8479cbd5b2b569122945e5a460431f3 Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Thu, 19 Dec 2024 21:40:42 +0100 Subject: [PATCH] Adjust samples to recent swap chain class changes --- examples/inputattachments/inputattachments.cpp | 6 +++--- examples/multisampling/multisampling.cpp | 2 +- examples/subpasses/subpasses.cpp | 2 +- examples/triangle/triangle.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/inputattachments/inputattachments.cpp b/examples/inputattachments/inputattachments.cpp index f562eff6..24b5130f 100644 --- a/examples/inputattachments/inputattachments.cpp +++ b/examples/inputattachments/inputattachments.cpp @@ -180,7 +180,7 @@ public: } // SRS - Recreate attachments and descriptors in case number of swapchain images has changed on resize - attachments.resize(swapChain.imageCount); + attachments.resize(swapChain.images.size()); for (auto i = 0; i < attachments.size(); i++) { createAttachment(colorFormat, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, &attachments[i].color); createAttachment(depthFormat, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, &attachments[i].depth); @@ -207,7 +207,7 @@ public: frameBufferCI.height = height; frameBufferCI.layers = 1; - frameBuffers.resize(swapChain.imageCount); + frameBuffers.resize(swapChain.images.size()); for (uint32_t i = 0; i < frameBuffers.size(); i++) { views[0] = swapChain.imageViews[i]; @@ -222,7 +222,7 @@ public: { attachmentSize = { width, height }; - attachments.resize(swapChain.imageCount); + attachments.resize(swapChain.images.size()); for (auto i = 0; i < attachments.size(); i++) { createAttachment(colorFormat, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, &attachments[i].color); createAttachment(depthFormat, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, &attachments[i].depth); diff --git a/examples/multisampling/multisampling.cpp b/examples/multisampling/multisampling.cpp index a39a9cc1..430ab642 100644 --- a/examples/multisampling/multisampling.cpp +++ b/examples/multisampling/multisampling.cpp @@ -330,7 +330,7 @@ public: frameBufferCreateInfo.layers = 1; // Create frame buffers for every swap chain image - frameBuffers.resize(swapChain.imageCount); + frameBuffers.resize(swapChain.images.size()); for (uint32_t i = 0; i < frameBuffers.size(); i++) { attachments[1] = swapChain.imageViews[i]; diff --git a/examples/subpasses/subpasses.cpp b/examples/subpasses/subpasses.cpp index e7cee1f1..72ab1109 100644 --- a/examples/subpasses/subpasses.cpp +++ b/examples/subpasses/subpasses.cpp @@ -248,7 +248,7 @@ public: frameBufferCreateInfo.layers = 1; // Create frame buffers for every swap chain image - frameBuffers.resize(swapChain.imageCount); + frameBuffers.resize(swapChain.images.size()); for (uint32_t i = 0; i < frameBuffers.size(); i++) { attachments[0] = swapChain.imageViews[i]; diff --git a/examples/triangle/triangle.cpp b/examples/triangle/triangle.cpp index d4ea1432..21c4954f 100644 --- a/examples/triangle/triangle.cpp +++ b/examples/triangle/triangle.cpp @@ -505,7 +505,7 @@ public: void setupFrameBuffer() { // Create a frame buffer for every image in the swapchain - frameBuffers.resize(swapChain.imageCount); + frameBuffers.resize(swapChain.images.size()); for (size_t i = 0; i < frameBuffers.size(); i++) { std::array attachments{};