MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / on_compile

Method on_compile

modules/render/render_graph/src/phases/cull_phase.cpp:11–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace render_graph {
10
11void CullPhase::on_compile(RenderGraph* graph) SKR_NOEXCEPT
12{
13 SkrZoneScopedN("RenderGraphCull");
14 auto& resources = get_resources(graph);
15 auto& passes = get_passes(graph);
16
17 resources.remove_all_if(
18 [this](ResourceNode* resource) {
19 SKR_UNUSED const auto name = resource->get_name_view();
20 SkrZoneScopedC(tracy::Color::SteelBlue);
21 ZoneName((const char*)name.raw().data(), name.size());
22
23 const bool lone = !(resource->incoming_edges() + resource->outgoing_edges());
24 {
25 SkrZoneScopedN("RecordDealloc");
26 if (lone) culled_resources.add(resource);
27 }
28 return lone;
29 });
30
31 passes.remove_all_if(
32 [this](PassNode* pass) {
33 SKR_UNUSED const auto name = pass->get_name_view();
34 SkrZoneScopedC(tracy::Color::SteelBlue);
35 ZoneName((const char*)name.raw().data(), name.size());
36
37 const bool lone = !(pass->incoming_edges() + pass->outgoing_edges());
38 const bool can_be_lone = pass->get_can_be_lone();
39 const bool culled = lone && !can_be_lone;
40 {
41 SkrZoneScopedN("RecordDealloc");
42 if (culled) culled_passes.add(pass);
43 }
44 return culled;
45 });
46}
47
48void CullPhase::on_execute(RenderGraph* graph, RenderGraphProfiler* profiler) SKR_NOEXCEPT
49{

Callers 1

compileMethod · 0.45

Calls 9

get_name_viewMethod · 0.80
outgoing_edgesMethod · 0.80
get_can_be_loneMethod · 0.80
remove_all_ifMethod · 0.45
dataMethod · 0.45
rawMethod · 0.45
sizeMethod · 0.45
incoming_edgesMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected