| 27 | {} |
| 28 | |
| 29 | void PostProcessingPipeline::draw(vkb::core::CommandBufferC &command_buffer, vkb::rendering::RenderTargetC &default_render_target) |
| 30 | { |
| 31 | for (current_pass_index = 0; current_pass_index < passes.size(); current_pass_index++) |
| 32 | { |
| 33 | auto &pass = *passes[current_pass_index]; |
| 34 | |
| 35 | if (pass.debug_name.empty()) |
| 36 | { |
| 37 | pass.debug_name = fmt::format("PPP pass #{}", current_pass_index); |
| 38 | } |
| 39 | ScopedDebugLabel marker{command_buffer, pass.debug_name.c_str()}; |
| 40 | |
| 41 | if (!pass.prepared) |
| 42 | { |
| 43 | ScopedDebugLabel marker{command_buffer, "Prepare"}; |
| 44 | |
| 45 | pass.prepare(command_buffer, default_render_target); |
| 46 | pass.prepared = true; |
| 47 | } |
| 48 | |
| 49 | if (pass.pre_draw) |
| 50 | { |
| 51 | ScopedDebugLabel marker{command_buffer, "Pre-draw"}; |
| 52 | |
| 53 | pass.pre_draw(); |
| 54 | } |
| 55 | |
| 56 | pass.draw(command_buffer, default_render_target); |
| 57 | |
| 58 | if (pass.post_draw) |
| 59 | { |
| 60 | ScopedDebugLabel marker{command_buffer, "Post-draw"}; |
| 61 | |
| 62 | pass.post_draw(); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | current_pass_index = 0; |
| 67 | } |
| 68 | |
| 69 | } // namespace vkb |