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

Method run

tutorials/verify/verify.cpp:3564–3608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3562 : VerifyApplication::IntersectTest(name,isa,imode,ivariant,VerifyApplication::TEST_SHOULD_PASS), sflags(sflags), quality(quality) {}
3563
3564 VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent)
3565 {
3566 std::string cfg = state->rtcore + ",isa="+stringOfISA(isa);
3567 RTCDeviceRef device = rtcNewDevice(cfg.c_str());
3568 errorHandler(nullptr,rtcGetDeviceError(device));
3569
3570 Vec3fa pos = zero;
3571 VerifyScene scene(device,sflags);
3572 scene.addSphere(sampler,RTC_BUILD_QUALITY_MEDIUM,pos,2.0f,50); // FIXME: use different geometries too
3573 rtcCommitScene (scene);
3574 AssertNoError(device);
3575
3576 RTCRayHit invalid_ray; clearRay(invalid_ray);
3577 invalid_ray.ray.tnear = pos_inf;
3578 invalid_ray.ray.tfar = 0.0f;
3579
3580 size_t numFailures = 0;
3581 for (size_t i=0; i<size_t(N*state->intensity); i++)
3582 {
3583 for (unsigned int M=1; M<maxStreamSize; M++)
3584 {
3585 bool valid[maxStreamSize];
3586 __aligned(16) RTCRayHit rays[maxStreamSize];
3587 for (unsigned int j=0; j<M; j++)
3588 {
3589 if (rand()%2) {
3590 valid[j] = true;
3591 Vec3fa org = 2.0f*random_Vec3fa()-Vec3fa(1.0f);
3592 Vec3fa dir = 2.0f*random_Vec3fa()-Vec3fa(1.0f);
3593 rays[j] = makeRay(pos+org,dir);
3594 } else {
3595 valid[j] = false;
3596 rays[j] = invalid_ray;
3597 }
3598 }
3599 IntersectWithMode(imode,ivariant,scene,rays,M);
3600 for (size_t j=0; j<M; j++) {
3601 if (valid[j]) continue;
3602 numFailures += neq_ray_special(rays[j],invalid_ray);
3603 }
3604 }
3605 }
3606 AssertNoError(device);
3607 return (VerifyApplication::TestReturnValue) (numFailures == 0);
3608 }
3609 };
3610
3611 struct WatertightTest : public VerifyApplication::IntersectTest

Callers

nothing calls this directly

Calls 14

stringOfISAFunction · 0.85
rtcNewDeviceFunction · 0.85
errorHandlerFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
rtcCommitSceneFunction · 0.85
AssertNoErrorFunction · 0.85
clearRayFunction · 0.85
makeRayFunction · 0.85
IntersectWithModeFunction · 0.85
neq_ray_specialFunction · 0.85
addSphereMethod · 0.80
__alignedClass · 0.50

Tested by

no test coverage detected