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

Method commit

kernels/common/scene_curves.cpp:341–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339 }
340
341 void CurveGeometry::commit()
342 {
343 if (curves) curves.buffer->commitIfNeeded();
344 /* verify that stride of all time steps are identical */
345 for (auto& buffer : vertices) {
346 if (buffer.getStride() != vertices[0].getStride())
347 throw_RTCError(RTC_ERROR_INVALID_OPERATION,"stride of vertex buffers have to be identical for each time step");
348 if (buffer) buffer.buffer->commitIfNeeded();
349 }
350 for (auto& buffer : normals) {
351 if (buffer.getStride() != normals[0].getStride())
352 throw_RTCError(RTC_ERROR_INVALID_OPERATION,"stride of normal buffers have to be identical for each time step");
353 if (buffer) buffer.buffer->commitIfNeeded();
354 }
355 for (auto& buffer : tangents) {
356 if (buffer.getStride() != tangents[0].getStride())
357 throw_RTCError(RTC_ERROR_INVALID_OPERATION,"stride of tangent buffers have to be identical for each time step");
358 if (buffer) buffer.buffer->commitIfNeeded();
359 }
360 for (auto& buffer : dnormals){
361 if (buffer.getStride() != dnormals[0].getStride())
362 throw_RTCError(RTC_ERROR_INVALID_OPERATION,"stride of normal derivative buffers have to be identical for each time step");
363 if (buffer) buffer.buffer->commitIfNeeded();
364 }
365 vertices0 = vertices[0];
366 if (getCurveType() == GTY_SUBTYPE_ORIENTED_CURVE)
367 {
368 normals0 = normals[0];
369 if (getCurveBasis() == GTY_BASIS_HERMITE)
370 dnormals0 = dnormals[0];
371 }
372 if (getCurveBasis() == GTY_BASIS_HERMITE)
373 tangents0 = tangents[0];
374
375 Geometry::commit();
376 }
377
378 size_t CurveGeometry::getGeometryDataDeviceByteSize() const {
379 size_t byte_size = sizeof(CurveGeometry);

Callers

nothing calls this directly

Calls 4

getCurveTypeFunction · 0.85
getCurveBasisFunction · 0.85
commitIfNeededMethod · 0.80
getStrideMethod · 0.80

Tested by

no test coverage detected