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

Method setup

tutorials/verify/verify.cpp:6127–6177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6125 }
6126
6127 bool setup(VerifyApplication* state)
6128 {
6129 std::string cfg = ",isa="+stringOfISA(isa) + ",threads=" + std::to_string((long long)numThreads)+","+state->rtcore;
6130 device = rtcNewDevice(cfg.c_str());
6131 errorHandler(nullptr,rtcGetDeviceError(device));
6132 rtcSetDeviceErrorFunction(device,errorHandler,nullptr);
6133 if (!dobenchmark) rtcSetDeviceMemoryMonitorFunction(device,memoryMonitor,nullptr);
6134
6135 for (unsigned int i=0; i<numMeshes; i++)
6136 {
6137 switch (gtype) {
6138 case TRIANGLE_MESH:
6139 case TRIANGLE_MESH_MB: geometries.push_back(SceneGraph::createTriangleSphere(zero,float(i+1),numPhi)); break;
6140 case QUAD_MESH:
6141 case QUAD_MESH_MB: geometries.push_back(SceneGraph::createQuadSphere(zero,float(i+1),numPhi)); break;
6142 case SUBDIV_MESH:
6143 case SUBDIV_MESH_MB: geometries.push_back(SceneGraph::createSubdivSphere(zero,float(i+1),8,float(numPhi)/8.0f)); break;
6144 case BEZIER_GEOMETRY:
6145 case BEZIER_GEOMETRY_MB:
6146 case BSPLINE_GEOMETRY:
6147 case BSPLINE_GEOMETRY_MB:
6148 case CATMULL_GEOMETRY:
6149 case CATMULL_GEOMETRY_MB: geometries.push_back(SceneGraph::createHairyPlane(i,Vec3fa(float(i)),Vec3fa(1,0,0),Vec3fa(0,1,0),0.01f,0.00001f,4*numPhi*numPhi,SceneGraph::FLAT_CURVE)); break;
6150 case LINE_GEOMETRY:
6151 case LINE_GEOMETRY_MB: geometries.push_back(SceneGraph::createHairyPlane(i,Vec3fa(float(i)),Vec3fa(1,0,0),Vec3fa(0,1,0),0.01f,0.00001f,4*numPhi*numPhi/3,SceneGraph::FLAT_CURVE)); break;
6152 default: throw std::runtime_error("invalid geometry for benchmark");
6153 }
6154
6155 switch (gtype) {
6156 case LINE_GEOMETRY:
6157 case LINE_GEOMETRY_MB: geometries.back() = SceneGraph::convert_bezier_to_lines(geometries.back()); break;
6158 default: break;
6159 }
6160
6161 switch (gtype) {
6162 case TRIANGLE_MESH_MB:
6163 case QUAD_MESH_MB:
6164 case SUBDIV_MESH_MB:
6165 case BEZIER_GEOMETRY_MB:
6166 case BSPLINE_GEOMETRY_MB:
6167 case CATMULL_GEOMETRY_MB:
6168 case LINE_GEOMETRY_MB: geometries.back() = geometries.back()->set_motion_vector(random_motion_vector2(0.0001f)); break;
6169 default: break;
6170 }
6171 }
6172
6173 if (update)
6174 create_scene();
6175
6176 return true;
6177 }
6178
6179 float benchmark(VerifyApplication* state)
6180 {

Callers

nothing calls this directly

Calls 11

stringOfISAFunction · 0.85
rtcNewDeviceFunction · 0.85
errorHandlerFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
to_stringFunction · 0.70
Vec3faClass · 0.50
c_strMethod · 0.45
push_backMethod · 0.45
set_motion_vectorMethod · 0.45

Tested by

no test coverage detected