MCPcopy Create free account
hub / github.com/RenderKit/embree / commit_task

Method commit_task

kernels/common/scene.cpp:828–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826 }
827
828 void Scene::commit_task ()
829 {
830 checkIfModifiedAndSet();
831 if (!isModified()) return;
832
833
834 /* print scene statistics */
835 if (device->verbosity(2))
836 printStatistics();
837
838 progress_monitor_counter = 0;
839
840 /* gather scene stats and call preCommit function of each geometry */
841 this->world = parallel_reduce (size_t(0), geometries.size(), GeometryCounts (),
842 [this](const range<size_t>& r)->GeometryCounts
843 {
844 GeometryCounts c;
845 for (auto i=r.begin(); i<r.end(); ++i)
846 {
847 if (geometries[i] && geometries[i]->isEnabled())
848 {
849 geometries[i]->preCommit();
850 geometries[i]->addElementsToCount (c);
851 c.numFilterFunctions += (int) geometries[i]->hasArgumentFilterFunctions();
852 c.numFilterFunctions += (int) geometries[i]->hasGeometryFilterFunctions();
853 }
854 }
855 return c;
856 },
857 std::plus<GeometryCounts>()
858 );
859
860 /* calculate maximal number of motion blur time segments in scene */
861 maxTimeSegments = 1;
862 for (size_t geomID=0; geomID<size(); geomID++)
863 {
864 Geometry* geom = get(geomID);
865 if (geom == nullptr) continue;
866 maxTimeSegments = std::max(maxTimeSegments, geom->numTimeSegments());
867 }
868
869#if defined(EMBREE_SYCL_SUPPORT)
870 DeviceGPU* gpu_device = dynamic_cast<DeviceGPU*>(device);
871 if (gpu_device)
872 build_gpu_accels();
873 else
874#endif
875 build_cpu_accels();
876
877 /* call postCommit function of each geometry */
878 parallel_for(geometries.size(), [&] ( const size_t i ) {
879 if (geometries[i] && geometries[i]->isEnabled()) {
880 geometries[i]->postCommit();
881 vertices[i] = geometries[i]->getCompactVertexArray();
882 geometryModCounters_[i] = geometries[i]->getModCounter();
883 }
884 });
885

Callers

nothing calls this directly

Calls 15

isModifiedFunction · 0.85
parallel_reduceFunction · 0.85
GeometryCountsClass · 0.85
parallel_forFunction · 0.85
setModifiedFunction · 0.85
postCommitMethod · 0.80
sizeFunction · 0.70
getFunction · 0.70
maxFunction · 0.50
verbosityMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected