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

Method commit

modules/cpu/geometry/Isosurfaces.cpp:43–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void Isosurfaces::commit()
44{
45 isovaluesData = getParamDataT<float>("isovalue", true, true);
46
47 volume = getParamObject<Volume>("volume");
48 if (!volume)
49 throw std::runtime_error(toString() + "must have 'volume'");
50
51 if (!isovaluesData->compact()) {
52 // get rid of stride
53 auto data = new Data(
54 getISPCDevice(), OSP_FLOAT, vec3ui(isovaluesData->size(), 1, 1));
55 data->copy(*isovaluesData, vec3ui(0));
56 isovaluesData = &(data->as<float>());
57 data->refDec();
58 }
59
60 if (vklHitContext) {
61 vklRelease(vklHitContext);
62 }
63
64 vklHitContext = vklNewHitIteratorContext(volume->vklSampler);
65
66 if (isovaluesData->size() > 0) {
67 VKLData valuesData = vklNewData(getISPCDevice().getVklDevice(),
68 isovaluesData->size(),
69 VKL_FLOAT,
70 isovaluesData->data());
71 vklSetData(vklHitContext, "values", valuesData);
72 vklRelease(valuesData);
73 }
74
75 vklCommit(vklHitContext);
76
77 createEmbreeUserGeometry((RTCBoundsFunction)&ispc::Isosurfaces_bounds);
78 getSh()->isovalues = isovaluesData->data();
79 getSh()->volume = volume->getSh();
80 getSh()->super.numPrimitives = numPrimitives();
81 getSh()->vklHitContext = vklHitContext;
82
83 postCreationInfo();
84}
85
86size_t Isosurfaces::numPrimitives() const
87{

Callers

nothing calls this directly

Calls 5

copyMethod · 0.80
getShMethod · 0.80
compactMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected