MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Hpp / createRenderPass

Function createRenderPass

samples/utils/utils.cpp:302–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300 }
301
302 vk::RenderPass createRenderPass(
303 vk::Device const & device, vk::Format colorFormat, vk::Format depthFormat, vk::AttachmentLoadOp loadOp, vk::ImageLayout colorFinalLayout )
304 {
305 std::vector<vk::AttachmentDescription> attachmentDescriptions;
306 assert( colorFormat != vk::Format::eUndefined );
307 attachmentDescriptions.emplace_back( vk::AttachmentDescriptionFlags(),
308 colorFormat,
309 vk::SampleCountFlagBits::e1,
310 loadOp,
311 vk::AttachmentStoreOp::eStore,
312 vk::AttachmentLoadOp::eDontCare,
313 vk::AttachmentStoreOp::eDontCare,
314 vk::ImageLayout::eUndefined,
315 colorFinalLayout );
316 if ( depthFormat != vk::Format::eUndefined )
317 {
318 attachmentDescriptions.emplace_back( vk::AttachmentDescriptionFlags(),
319 depthFormat,
320 vk::SampleCountFlagBits::e1,
321 loadOp,
322 vk::AttachmentStoreOp::eDontCare,
323 vk::AttachmentLoadOp::eDontCare,
324 vk::AttachmentStoreOp::eDontCare,
325 vk::ImageLayout::eUndefined,
326 vk::ImageLayout::eDepthStencilAttachmentOptimal );
327 }
328 vk::AttachmentReference colorAttachment( 0, vk::ImageLayout::eColorAttachmentOptimal );
329 vk::AttachmentReference depthAttachment( 1, vk::ImageLayout::eDepthStencilAttachmentOptimal );
330 vk::SubpassDescription subpassDescription( vk::SubpassDescriptionFlags(),
331 vk::PipelineBindPoint::eGraphics,
332 {},
333 colorAttachment,
334 {},
335 ( depthFormat != vk::Format::eUndefined ) ? &depthAttachment : nullptr );
336 return device.createRenderPass( vk::RenderPassCreateInfo( vk::RenderPassCreateFlags(), attachmentDescriptions, subpassDescription ) );
337 }
338
339 VKAPI_ATTR vk::Bool32 VKAPI_CALL debugUtilsMessengerCallback( vk::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
340 vk::DebugUtilsMessageTypeFlagsEXT messageTypes,

Callers 15

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected