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

Method setup

tutorials/verify/verify.cpp:5945–5975  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5943 }
5944
5945 bool setup(VerifyApplication* state)
5946 {
5947 if (!ParallelIntersectBenchmark::setup(state))
5948 return false;
5949
5950 std::string cfg = state->rtcore + ",isa="+stringOfISA(isa);
5951 device = rtcNewDevice(cfg.c_str());
5952 errorHandler(nullptr,rtcGetDeviceError(device));
5953 rtcSetDeviceErrorFunction(device,errorHandler,nullptr);
5954
5955 scene = new VerifyScene(device,sflags);
5956 switch (gtype) {
5957 case TRIANGLE_MESH: scene->addGeometry(quality,SceneGraph::createTriangleSphere(zero,one,numPhi)); break;
5958 case TRIANGLE_MESH_MB: scene->addGeometry(quality,SceneGraph::createTriangleSphere(zero,one,numPhi)->set_motion_vector(random_motion_vector2(0.01f))); break;
5959 case QUAD_MESH: scene->addGeometry(quality,SceneGraph::createQuadSphere(zero,one,numPhi)); break;
5960 case QUAD_MESH_MB: scene->addGeometry(quality,SceneGraph::createQuadSphere(zero,one,numPhi)->set_motion_vector(random_motion_vector2(0.01f))); break;
5961 case SUBDIV_MESH: scene->addGeometry(quality,SceneGraph::createSubdivSphere(zero,one,8,float(numPhi)/8.0f)); break;
5962 case SUBDIV_MESH_MB: scene->addGeometry(quality,SceneGraph::createSubdivSphere(zero,one,8,float(numPhi)/8.0f)->set_motion_vector(random_motion_vector2(0.01f))); break;
5963 case SPHERE_GEOMETRY: scene->addGeometry(quality,SceneGraph::createPointSphere(zero, one, float(one)/100.f, numPhi, SceneGraph::SPHERE)); break;
5964 case SPHERE_GEOMETRY_MB: scene->addGeometry(quality,SceneGraph::createPointSphere(zero, one, float(one)/100.f, numPhi, SceneGraph::SPHERE)->set_motion_vector(random_motion_vector2(0.01f))); break;
5965 case DISC_GEOMETRY: scene->addGeometry(quality,SceneGraph::createPointSphere(zero, one, float(one)/100.f, numPhi, SceneGraph::DISC)); break;
5966 case DISC_GEOMETRY_MB: scene->addGeometry(quality,SceneGraph::createPointSphere(zero, one, float(one)/100.f, numPhi, SceneGraph::DISC)->set_motion_vector(random_motion_vector2(0.01f))); break;
5967 case ORIENTED_DISC_GEOMETRY: scene->addGeometry(quality,SceneGraph::createPointSphere(zero, one, float(one)/100.f, numPhi, SceneGraph::ORIENTED_DISC)); break;
5968 case ORIENTED_DISC_GEOMETRY_MB: scene->addGeometry(quality,SceneGraph::createPointSphere(zero, one, float(one)/100.f, numPhi, SceneGraph::ORIENTED_DISC)->set_motion_vector(random_motion_vector2(0.01f))); break;
5969 default: throw std::runtime_error("invalid geometry for benchmark");
5970 }
5971 rtcCommitScene (*scene);
5972 AssertNoError(device);
5973
5974 return true;
5975 }
5976
5977 void render_block(size_t i, size_t dn)
5978 {

Callers

nothing calls this directly

Calls 10

stringOfISAFunction · 0.85
rtcNewDeviceFunction · 0.85
errorHandlerFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
rtcCommitSceneFunction · 0.85
AssertNoErrorFunction · 0.85
addGeometryMethod · 0.80
c_strMethod · 0.45
set_motion_vectorMethod · 0.45

Tested by

no test coverage detected