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

Method commit

modules/cpu/common/World.cpp:70–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void World::commit()
71{
72 RTCScene &esGeom = getSh()->embreeSceneHandleGeometries;
73#ifdef OSPRAY_ENABLE_VOLUMES
74 RTCScene &esVol = getSh()->embreeSceneHandleVolumes;
75#endif
76#ifndef OSPRAY_TARGET_SYCL
77 RTCScene &esClip = getSh()->embreeSceneHandleClippers;
78#endif
79
80 freeAndNullifyEmbreeScene(esGeom);
81#ifdef OSPRAY_ENABLE_VOLUMES
82 freeAndNullifyEmbreeScene(esVol);
83#endif
84#ifndef OSPRAY_TARGET_SYCL
85 freeAndNullifyEmbreeScene(esClip);
86#endif
87
88 scivisData = nullptr;
89 pathtracerData = nullptr;
90
91 instances = getParamDataT<Instance *>("instance");
92 lights = getParamDataT<Light *>("light");
93
94 auto numInstances = instances ? instances->size() : 0;
95
96 int sceneFlags = RTC_SCENE_FLAG_NONE;
97 RTCBuildQuality buildQuality = RTC_BUILD_QUALITY_HIGH;
98 if (getParam<bool>("dynamicScene", false)) {
99 sceneFlags |= RTC_SCENE_FLAG_DYNAMIC;
100 buildQuality = RTC_BUILD_QUALITY_LOW;
101 }
102 sceneFlags |=
103 (getParam<bool>("compactMode", false) ? RTC_SCENE_FLAG_COMPACT : 0);
104 sceneFlags |=
105 (getParam<bool>("robustMode", false) ? RTC_SCENE_FLAG_ROBUST : 0);
106
107 postStatusMsg(OSP_LOG_DEBUG)
108 << "=======================================================\n"
109 << "Committing world, which has " << numInstances << " instances and "
110 << (lights ? lights->size() : 0) << " lights";
111
112 instanceArray = nullptr;
113 getSh()->numInvertedClippers = 0;
114
115 RTCDevice embreeDevice = getISPCDevice().getEmbreeDevice();
116 if (instances) {
117 for (auto &&inst : *instances)
118#ifndef OSPRAY_TARGET_SYCL
119 if (inst->group->sceneClippers)
120 getSh()->numInvertedClippers += inst->group->numInvertedClippers;
121#endif
122
123 // Create shared buffers for instance pointers
124 instanceArray = devicert::make_buffer_shared_unique<ispc::Instance *>(
125 getISPCDevice().getDRTDevice(),
126 sizeof(ispc::Instance *) * numInstances);
127 getSh()->instances = instanceArray->sharedPtr();

Callers

nothing calls this directly

Calls 8

postStatusMsgFunction · 0.85
addGeometryInstanceFunction · 0.85
sharedPtrMethod · 0.80
resetMethod · 0.80
getShMethod · 0.80
sizeMethod · 0.45
getFeatureFlagsMethod · 0.45

Tested by

no test coverage detected