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

Method convertToDeviceRepresentation

kernels/common/scene_points.cpp:205–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203 }
204
205 void Points::convertToDeviceRepresentation(size_t offset, char* data_host, char* data_device) const {
206 Points* points = (Points*)(data_host + offset);
207 std::memcpy(data_host + offset, (void*)this, sizeof(Points));
208 offset += sizeof(Points);
209 if (vertices.size() > 0) {
210 const size_t offsetVertices = offset;
211 for (size_t t = 0; t < numTimeSteps; ++t) {
212 std::memcpy(data_host + offset, &(vertices[t]), sizeof(BufferView<Vec3ff>));
213 offset += sizeof(BufferView<Vec3ff>);
214 }
215 points->vertices.setDataPtr((BufferView<Vec3ff>*)(data_device + offsetVertices));
216 }
217 if (normals.size() > 0) {
218 const size_t offsetNormals = offset;
219 for (size_t t = 0; t < numTimeSteps; ++t) {
220 std::memcpy(data_host + offset, &(normals[t]), sizeof(BufferView<Vec3fa>));
221 offset += sizeof(BufferView<Vec3fa>);
222 }
223 points->normals.setDataPtr((BufferView<Vec3fa>*)(data_device + offsetNormals));
224 }
225 }
226
227#endif
228

Callers 1

syncWithDeviceMethod · 0.45

Calls 2

setDataPtrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected