MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / prepare_draw

Method prepare_draw

framework/rendering/postprocessing_renderpass.cpp:462–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462void PostProcessingRenderPass::prepare_draw(vkb::core::CommandBufferC &command_buffer, vkb::rendering::RenderTargetC &fallback_render_target)
463{
464 // Collect all input, output, and sampled-from attachments from all subpasses (steps)
465 AttachmentSet input_attachments, output_attachments;
466 SampledAttachmentSet sampled_attachments;
467
468 for (auto &step_ptr : pipeline.get_subpasses())
469 {
470 auto &step = *dynamic_cast<PostProcessingSubpass *>(step_ptr.get());
471
472 for (auto &it : step.get_input_attachments())
473 {
474 input_attachments.insert(it.second);
475 }
476
477 for (auto &it : step.get_sampled_images())
478 {
479 if (const uint32_t *sampled_attachment = it.second.get_target_attachment())
480 {
481 auto *image_rt = it.second.get_render_target();
482 auto packed_sampled_attachment = *sampled_attachment;
483
484 // pack sampled attachment
485 if (it.second.is_depth_resolve())
486 {
487 packed_sampled_attachment |= DEPTH_RESOLVE_BITMASK;
488 }
489
490 sampled_attachments.insert({image_rt, packed_sampled_attachment});
491 }
492 }
493
494 for (uint32_t it : step.get_output_attachments())
495 {
496 output_attachments.insert(it);
497 }
498 }
499
500 transition_attachments(input_attachments, sampled_attachments, output_attachments,
501 command_buffer, fallback_render_target);
502 update_load_stores(input_attachments, sampled_attachments, output_attachments,
503 fallback_render_target);
504}
505
506void PostProcessingRenderPass::draw(vkb::core::CommandBufferC &command_buffer, vkb::rendering::RenderTargetC &default_render_target)
507{

Callers

nothing calls this directly

Calls 5

get_target_attachmentMethod · 0.80
is_depth_resolveMethod · 0.80
getMethod · 0.45
insertMethod · 0.45
get_render_targetMethod · 0.45

Tested by

no test coverage detected