26 m_desc.pipelineBindPoint = vk::PipelineBindPoint::eGraphics;
34 ref.attachment = VK_ATTACHMENT_UNUSED;
35 ref.layout = vk::ImageLayout::eUndefined;
41 ref.layout = vk::ImageLayout::eColorAttachmentOptimal;
44 m_desc.colorAttachmentCount = maxSlot + 1;
47 m_desc.colorAttachmentCount = 0;
48 m_desc.pColorAttachments =
nullptr;
57 fout <<
"Pass using depth stencil attachment with index: "
60 m_desc.pDepthStencilAttachment =
nullptr;
74 std::vector<vk::ClearAttachment> clearAttachments;
79 vk::ClearAttachment clearAttachment;
80 clearAttachment.aspectMask = vk::ImageAspectFlagBits::eColor;
81 clearAttachment.colorAttachment = slot;
82 clearAttachment.clearValue.color = vk::ClearColorValue(std::array<float, 4>{
88 clearAttachments.push_back(clearAttachment);
96 vk::ClearAttachment clearAttachment;
97 clearAttachment.aspectMask = vk::ImageAspectFlagBits::eNone;
100 clearAttachment.aspectMask |= vk::ImageAspectFlagBits::eDepth;
104 clearAttachment.aspectMask |= vk::ImageAspectFlagBits::eStencil;
107 clearAttachment.clearValue.depthStencil = vk::ClearDepthStencilValue(
112 clearAttachments.push_back(clearAttachment);
115 if (!clearAttachments.empty()) {
116 vk::ClearRect clearRect;
117 clearRect.rect.offset = vk::Offset2D(0, 0);
119 uint32_t width = 0, height = 0;
122 width = firstTarget->width();
123 height = firstTarget->height();
129 clearRect.rect.extent = vk::Extent2D(width, height);
130 clearRect.baseArrayLayer = 0;
131 clearRect.layerCount = 1;
133 vkCmdBuf->commandBuffer().clearAttachments(clearAttachments, clearRect);
149 std::vector<vk::ClearAttachment> clearAttachments;
154 vk::ClearAttachment clearAttachment;
155 clearAttachment.aspectMask = vk::ImageAspectFlagBits::eColor;
156 clearAttachment.colorAttachment = slot;
157 clearAttachment.clearValue.color = vk::ClearColorValue(std::array<float, 4>{
163 clearAttachments.push_back(clearAttachment);
171 vk::ClearAttachment clearAttachment;
172 clearAttachment.aspectMask = vk::ImageAspectFlagBits::eNone;
175 clearAttachment.aspectMask |= vk::ImageAspectFlagBits::eDepth;
179 clearAttachment.aspectMask |= vk::ImageAspectFlagBits::eStencil;
182 clearAttachment.clearValue.depthStencil = vk::ClearDepthStencilValue(
187 clearAttachments.push_back(clearAttachment);
190 if (!clearAttachments.empty()) {
191 vk::ClearRect clearRect;
192 clearRect.rect.offset = vk::Offset2D(0, 0);
194 uint32_t width = 0, height = 0;
197 width = firstTarget->width();
198 height = firstTarget->height();
204 clearRect.rect.extent = vk::Extent2D(width, height);
205 clearRect.baseArrayLayer = 0;
206 clearRect.layerCount = 1;
208 vkCmdBuf->commandBuffer().clearAttachments(clearAttachments, clearRect);