22 m_desc.pipelineBindPoint = vk::PipelineBindPoint::eGraphics;
30 ref.attachment = VK_ATTACHMENT_UNUSED;
31 ref.layout = vk::ImageLayout::eUndefined;
37 ref.layout = vk::ImageLayout::eColorAttachmentOptimal;
40 m_desc.colorAttachmentCount = maxSlot + 1;
43 m_desc.colorAttachmentCount = 0;
44 m_desc.pColorAttachments =
nullptr;
53 fout <<
"Pass using depth stencil attachment with index: "
56 m_desc.pDepthStencilAttachment =
nullptr;
70 std::vector<vk::ClearAttachment> clearAttachments;
75 vk::ClearAttachment clearAttachment;
76 clearAttachment.aspectMask = vk::ImageAspectFlagBits::eColor;
77 clearAttachment.colorAttachment = slot;
78 clearAttachment.clearValue.color = vk::ClearColorValue(std::array<float, 4>{
84 clearAttachments.push_back(clearAttachment);
92 vk::ClearAttachment clearAttachment;
93 clearAttachment.aspectMask = vk::ImageAspectFlagBits::eNone;
96 clearAttachment.aspectMask |= vk::ImageAspectFlagBits::eDepth;
100 clearAttachment.aspectMask |= vk::ImageAspectFlagBits::eStencil;
103 clearAttachment.clearValue.depthStencil = vk::ClearDepthStencilValue(
108 clearAttachments.push_back(clearAttachment);
111 if (!clearAttachments.empty()) {
112 vk::ClearRect clearRect;
113 clearRect.rect.offset = vk::Offset2D(0, 0);
115 uint32_t width = 0, height = 0;
118 width = firstTarget->width();
119 height = firstTarget->height();
125 clearRect.rect.extent = vk::Extent2D(width, height);
126 clearRect.baseArrayLayer = 0;
127 clearRect.layerCount = 1;
129 vkCmdBuf->commandBuffer().clearAttachments(clearAttachments, clearRect);
145 std::vector<vk::ClearAttachment> clearAttachments;
150 vk::ClearAttachment clearAttachment;
151 clearAttachment.aspectMask = vk::ImageAspectFlagBits::eColor;
152 clearAttachment.colorAttachment = slot;
153 clearAttachment.clearValue.color = vk::ClearColorValue(std::array<float, 4>{
159 clearAttachments.push_back(clearAttachment);
167 vk::ClearAttachment clearAttachment;
168 clearAttachment.aspectMask = vk::ImageAspectFlagBits::eNone;
171 clearAttachment.aspectMask |= vk::ImageAspectFlagBits::eDepth;
175 clearAttachment.aspectMask |= vk::ImageAspectFlagBits::eStencil;
178 clearAttachment.clearValue.depthStencil = vk::ClearDepthStencilValue(
183 clearAttachments.push_back(clearAttachment);
186 if (!clearAttachments.empty()) {
187 vk::ClearRect clearRect;
188 clearRect.rect.offset = vk::Offset2D(0, 0);
190 uint32_t width = 0, height = 0;
193 width = firstTarget->width();
194 height = firstTarget->height();
200 clearRect.rect.extent = vk::Extent2D(width, height);
201 clearRect.baseArrayLayer = 0;
202 clearRect.layerCount = 1;
204 vkCmdBuf->commandBuffer().clearAttachments(clearAttachments, clearRect);