MCPcopy Create free account
hub / github.com/RenderKit/ospray / commit

Method commit

modules/mpi/ospray/common/DistributedWorld.cpp:43–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void DistributedWorld::commit()
44{
45 World::commit();
46
47 allRegions.clear();
48 myRegions.clear();
49 myRegionIds.clear();
50 regionOwners.clear();
51
52 localRegions = getParamDataT<box3f>("region");
53 if (localRegions) {
54 std::copy(localRegions->begin(),
55 localRegions->end(),
56 std::back_inserter(myRegions));
57 } else {
58 // Assume we're going to treat everything on this node as a one region,
59 // either for data-parallel rendering or to switch to replicated
60 // rendering
61 box3f localBounds;
62 if (getSh()->super.embreeSceneHandleGeometries) {
63 box4f b;
64 rtcGetSceneBounds(
65 getSh()->super.embreeSceneHandleGeometries, (RTCBounds *)&b);
66 localBounds.extend(box3f(vec3f(b.lower.x, b.lower.y, b.lower.z),
67 vec3f(b.upper.x, b.upper.y, b.upper.z)));
68 }
69
70#ifdef OSPRAY_ENABLE_VOLUMES
71 if (getSh()->super.embreeSceneHandleVolumes) {
72 box4f b;
73 rtcGetSceneBounds(
74 getSh()->super.embreeSceneHandleVolumes, (RTCBounds *)&b);
75 localBounds.extend(box3f(vec3f(b.lower.x, b.lower.y, b.lower.z),
76 vec3f(b.upper.x, b.upper.y, b.upper.z)));
77 }
78#endif
79 myRegions.push_back(localBounds);
80 }
81
82 // Figure out the unique regions on this node which we can send
83 // to the others to build the distributed world
84 std::sort(
85 myRegions.begin(), myRegions.end(), [](const box3f &a, const box3f &b) {
86 return a.lower < b.lower || (a.lower == b.lower && a.upper < b.upper);
87 });
88 auto last = std::unique(myRegions.begin(), myRegions.end());
89 myRegions.erase(last, myRegions.end());
90
91 exchangeRegions();
92
93 if (regionScene) {
94 rtcReleaseScene(regionScene);
95 regionScene = nullptr;
96 }
97
98 if (allRegions.size() > 0) {
99 // Setup the boxes geometry which we'll use to leverage Embree for
100 // accurately determining region visibility

Callers

nothing calls this directly

Calls 8

getEmbreeGeometryMethod · 0.80
commitFunction · 0.70
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
setParamMethod · 0.45

Tested by

no test coverage detected