MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ create_default_color_depth()

RenderPassCreateInfo MayaFlux::Core::VKRenderPass::create_default_color_depth ( vk::Format  color_format,
vk::Format  depth_format 
)
static

Definition at line 166 of file VKRenderPass.cpp.

167{
168 RenderPassCreateInfo create_info;
169
170 AttachmentDescription color_attachment;
171 color_attachment.format = color_format;
172 color_attachment.load_op = vk::AttachmentLoadOp::eClear;
173 color_attachment.store_op = vk::AttachmentStoreOp::eStore;
174 color_attachment.initial_layout = vk::ImageLayout::eUndefined;
175 color_attachment.final_layout = vk::ImageLayout::ePresentSrcKHR;
176 create_info.attachments.push_back(color_attachment);
177
178 AttachmentDescription depth_attachment;
179 depth_attachment.format = depth_format;
180 depth_attachment.load_op = vk::AttachmentLoadOp::eClear;
181 depth_attachment.store_op = vk::AttachmentStoreOp::eDontCare;
182 depth_attachment.stencil_load_op = vk::AttachmentLoadOp::eDontCare;
183 depth_attachment.stencil_store_op = vk::AttachmentStoreOp::eDontCare;
184 depth_attachment.initial_layout = vk::ImageLayout::eUndefined;
185 depth_attachment.final_layout = vk::ImageLayout::eDepthStencilAttachmentOptimal;
186 create_info.attachments.push_back(depth_attachment);
187
188 SubpassDescription subpass;
189 subpass.color_attachments.emplace_back(0, vk::ImageLayout::eColorAttachmentOptimal);
190 subpass.depth_stencil_attachment = { 1, vk::ImageLayout::eDepthStencilAttachmentOptimal };
191 create_info.subpasses.push_back(subpass);
192
193 SubpassDependency dependency;
194 dependency.src_subpass = VK_SUBPASS_EXTERNAL;
195 dependency.dst_subpass = 0;
196 dependency.src_stage_mask = vk::PipelineStageFlagBits::eColorAttachmentOutput | vk::PipelineStageFlagBits::eEarlyFragmentTests;
197 dependency.dst_stage_mask = vk::PipelineStageFlagBits::eColorAttachmentOutput | vk::PipelineStageFlagBits::eEarlyFragmentTests;
198 dependency.dst_access_mask = vk::AccessFlagBits::eColorAttachmentWrite | vk::AccessFlagBits::eDepthStencilAttachmentWrite;
199 create_info.dependencies.push_back(dependency);
200
201 return create_info;
202}

References MayaFlux::Core::RenderPassCreateInfo::attachments, MayaFlux::Core::SubpassDescription::color_attachments, MayaFlux::Core::RenderPassCreateInfo::dependencies, MayaFlux::Core::SubpassDescription::depth_stencil_attachment, MayaFlux::Core::SubpassDependency::dst_access_mask, MayaFlux::Core::SubpassDependency::dst_stage_mask, MayaFlux::Core::SubpassDependency::dst_subpass, MayaFlux::Core::AttachmentDescription::final_layout, MayaFlux::Core::AttachmentDescription::format, MayaFlux::Core::AttachmentDescription::initial_layout, MayaFlux::Core::AttachmentDescription::load_op, MayaFlux::Core::SubpassDependency::src_stage_mask, MayaFlux::Core::SubpassDependency::src_subpass, MayaFlux::Core::AttachmentDescription::stencil_load_op, MayaFlux::Core::AttachmentDescription::stencil_store_op, MayaFlux::Core::AttachmentDescription::store_op, and MayaFlux::Core::RenderPassCreateInfo::subpasses.