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

Method run_build

tutorials/verify/verify.cpp:1414–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1412 }
1413
1414 std::pair<ssize_t,ssize_t> run_build(VerifyApplication* state, size_t N, unsigned numThreads)
1415 {
1416 std::string cfg = state->rtcore + ",isa="+stringOfISA(isa) + ",threads="+std::to_string((long long)numThreads);
1417 RTCDeviceRef device = rtcNewDevice(cfg.c_str());
1418 errorHandler(nullptr,rtcGetDeviceError(device));
1419 memory_consumption_bytes_used = 0;
1420 rtcSetDeviceMemoryMonitorFunction(device,memoryMonitor,nullptr);
1421 VerifyScene scene(device,sflags);
1422 AssertNoError(device);
1423
1424 int numPhi = (size_t) ceilf(sqrtf(N/4.0f));
1425 ssize_t NN = 0;
1426
1427 float plen = sqrtf(N/100000.0f);
1428 Vec3fa planeX = plen*normalize(Vec3fa(1,1,0));
1429 Vec3fa planeY = plen*normalize(Vec3fa(0,1,1));
1430
1431 Ref<SceneGraph::Node> mesh;
1432 int i = 0;
1433 switch (gtype) {
1434 case TRIANGLE_MESH:
1435 case TRIANGLE_MESH_MB: mesh = SceneGraph::createTriangleSphere(zero,float(i+1),numPhi); break;
1436 case QUAD_MESH:
1437 case QUAD_MESH_MB: mesh = SceneGraph::createQuadSphere(zero,float(i+1),numPhi); break;
1438 case SUBDIV_MESH:
1439 case SUBDIV_MESH_MB: mesh = SceneGraph::createSubdivSphere(zero,float(i+1),8,float(numPhi)/8.0f); break;
1440 case BEZIER_GEOMETRY:
1441 case BEZIER_GEOMETRY_MB:
1442 case BSPLINE_GEOMETRY:
1443 case BSPLINE_GEOMETRY_MB:
1444 case CATMULL_GEOMETRY:
1445 case CATMULL_GEOMETRY_MB: mesh = SceneGraph::createHairyPlane(i,Vec3fa(float(i)),planeX,planeY,0.01f,0.00001f,4*numPhi*numPhi,SceneGraph::FLAT_CURVE); break;
1446 case LINE_GEOMETRY:
1447 case LINE_GEOMETRY_MB: mesh = SceneGraph::createHairyPlane(i,Vec3fa(float(i)),planeX,planeY,0.01f,0.00001f,4*numPhi*numPhi/3,SceneGraph::FLAT_CURVE); break;
1448 default: throw std::runtime_error("invalid geometry for benchmark");
1449 }
1450
1451 switch (gtype) {
1452 case LINE_GEOMETRY:
1453 case LINE_GEOMETRY_MB: mesh = SceneGraph::convert_bezier_to_lines(mesh); break;
1454 default: break;
1455 }
1456
1457 switch (gtype) {
1458 case TRIANGLE_MESH_MB:
1459 case QUAD_MESH_MB:
1460 case SUBDIV_MESH_MB:
1461 case BEZIER_GEOMETRY_MB:
1462 case BSPLINE_GEOMETRY_MB:
1463 case CATMULL_GEOMETRY_MB:
1464 case LINE_GEOMETRY_MB: mesh = mesh->set_motion_vector(random_motion_vector2(0.0001f)); break;
1465 default: break;
1466 }
1467 NN = mesh->numPrimitives();
1468 scene.addGeometry(quality,mesh);
1469 rtcCommitScene (scene);
1470 AssertNoError(device);
1471

Callers

nothing calls this directly

Calls 15

stringOfISAFunction · 0.85
rtcNewDeviceFunction · 0.85
errorHandlerFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
AssertNoErrorFunction · 0.85
rtcCommitSceneFunction · 0.85
addGeometryMethod · 0.80
to_stringFunction · 0.70
normalizeFunction · 0.50
Vec3faClass · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected