Skip to content

Commit

Permalink
Adjust samples to recent swap chain class changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaWillems committed Dec 19, 2024
1 parent dcec337 commit e927058
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/inputattachments/inputattachments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class VulkanExample : public VulkanExampleBase
}

// 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);
Expand All @@ -207,7 +207,7 @@ class VulkanExample : public VulkanExampleBase
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];
Expand All @@ -222,7 +222,7 @@ class VulkanExample : public VulkanExampleBase
{
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);
Expand Down
2 changes: 1 addition & 1 deletion examples/multisampling/multisampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ class VulkanExample : public VulkanExampleBase
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];
Expand Down
2 changes: 1 addition & 1 deletion examples/subpasses/subpasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class VulkanExample : public VulkanExampleBase
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];
Expand Down
2 changes: 1 addition & 1 deletion examples/triangle/triangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ class VulkanExample : public VulkanExampleBase
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<VkImageView, 2> attachments{};
Expand Down

0 comments on commit e927058

Please sign in to comment.