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

Method find

kernels/builders/heuristic_spatial_array.h:170–197  ·  view source on GitHub ↗

! finds the best split */

Source from the content-addressed store, hash-verified

168
169 /*! finds the best split */
170 const Split find(const PrimInfoExtRange& set, const size_t logBlockSize)
171 {
172 SplitInfo oinfo;
173 const ObjectSplit object_split = object_find(set,logBlockSize,oinfo);
174 const float object_split_sah = object_split.splitSAH();
175
176 if (unlikely(set.has_ext_range()))
177 {
178 const BBox3fa overlap = intersect(oinfo.leftBounds, oinfo.rightBounds);
179
180 /* do only spatial splits if the child bounds overlap */
181 if (safeArea(overlap) >= SPATIAL_ASPLIT_AREA_THRESHOLD*safeArea(root_info.geomBounds) &&
182 safeArea(overlap) >= SPATIAL_ASPLIT_OVERLAP_THRESHOLD*safeArea(set.geomBounds))
183 {
184 const SpatialSplit spatial_split = spatial_find(set, logBlockSize);
185 const float spatial_split_sah = spatial_split.splitSAH();
186
187 /* valid spatial split, better SAH and number of splits do not exceed extended range */
188 if (spatial_split_sah < SPATIAL_ASPLIT_SAH_THRESHOLD*object_split_sah &&
189 spatial_split.left + spatial_split.right - set.size() <= set.ext_range_size())
190 {
191 return Split(spatial_split,spatial_split_sah);
192 }
193 }
194 }
195
196 return Split(object_split,object_split_sah);
197 }
198
199 /*! finds the best object split */
200 __forceinline const ObjectSplit object_find(const PrimInfoExtRange& set, const size_t logBlockSize, SplitInfo &info)

Callers

nothing calls this directly

Calls 7

safeAreaFunction · 0.85
SplitClass · 0.85
has_ext_rangeMethod · 0.80
ext_range_sizeMethod · 0.80
intersectFunction · 0.50
splitSAHMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected