Swapchain code cleanup

Use references instead of pointers
This commit is contained in:
Sascha Willems 2024-12-19 21:29:22 +01:00
parent 372cab5779
commit dcec337fa9
12 changed files with 65 additions and 85 deletions

View file

@ -104,7 +104,7 @@ public:
// This set of barriers prepares the color and depth images for output
vks::tools::insertImageMemoryBarrier(
drawCmdBuffers[i],
swapChain.buffers[i].image,
swapChain.images[i],
0,
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
VK_IMAGE_LAYOUT_UNDEFINED,
@ -126,7 +126,7 @@ public:
// New structures are used to define the attachments used in dynamic rendering
VkRenderingAttachmentInfoKHR colorAttachment{};
colorAttachment.sType = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR;
colorAttachment.imageView = swapChain.buffers[i].view;
colorAttachment.imageView = swapChain.imageViews[i];
colorAttachment.imageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
colorAttachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
colorAttachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
@ -173,7 +173,7 @@ public:
// This set of barriers prepares the color image for presentation, we don't need to care for the depth image
vks::tools::insertImageMemoryBarrier(
drawCmdBuffers[i],
swapChain.buffers[i].image,
swapChain.images[i],
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
0,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,