| 88 | } |
| 89 | |
| 90 | void render(skr::render_graph::RenderGraph* render_graph) override |
| 91 | { |
| 92 | // produce draw calls |
| 93 | { |
| 94 | SkrZoneScopedN("ForeachProcessors(Sync)"); |
| 95 | for (auto& processor : processors) |
| 96 | { |
| 97 | skr_primitive_update_context_t update_context = {}; |
| 98 | update_context.renderer = this; |
| 99 | update_context.render_graph = render_graph; |
| 100 | update_context.storage = storage; |
| 101 | |
| 102 | processor->on_update(&update_context); |
| 103 | } |
| 104 | |
| 105 | for (auto& pass : passes) |
| 106 | { |
| 107 | draw_packets[pass->identity()].clear(); |
| 108 | // used out |
| 109 | for (auto& processor : processors) |
| 110 | { |
| 111 | if (pass && processor) |
| 112 | { |
| 113 | SkrZoneScopedN("ProduceDrawPacket"); |
| 114 | |
| 115 | skr_primitive_draw_context_t draw_context = {}; |
| 116 | draw_context.renderer = this; |
| 117 | draw_context.render_graph = render_graph; |
| 118 | draw_context.pass = pass; |
| 119 | draw_context.storage = storage; |
| 120 | |
| 121 | auto packet = processor->produce_draw_packets(&draw_context); |
| 122 | draw_packets[pass->identity()].add(packet); |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | for (auto& processor : processors) |
| 128 | { |
| 129 | skr_primitive_update_context_t update_context = {}; |
| 130 | update_context.renderer = this; |
| 131 | update_context.render_graph = render_graph; |
| 132 | update_context.storage = storage; |
| 133 | |
| 134 | processor->post_update(&update_context); |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | // execute draw calls |
| 139 | { |
| 140 | SkrZoneScopedN("ForeachPasses(Sync)"); |
| 141 | for (auto& pass : passes) |
| 142 | { |
| 143 | if (pass) |
| 144 | { |
| 145 | skr_primitive_pass_context_t pass_context = {}; |
| 146 | pass_context.renderer = this; |
| 147 | pass_context.render_graph = render_graph; |
nothing calls this directly
no test coverage detected