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

Method run

tutorials/verify/verify.cpp:1652–1697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1650 : VerifyApplication::Test(name,isa,VerifyApplication::TEST_SHOULD_PASS), sflags(sflags) {}
1651
1652 VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent)
1653 {
1654 std::string cfg = state->rtcore + ",isa="+stringOfISA(isa);
1655 RTCDeviceRef device = rtcNewDevice(cfg.c_str());
1656 errorHandler(nullptr,rtcGetDeviceError(device));
1657 VerifyScene scene(device,sflags);
1658 AssertNoError(device);
1659 unsigned geom0 = scene.addSphere (sampler,RTC_BUILD_QUALITY_MEDIUM,Vec3fa(-1,0,-1),1.0f,50).first;
1660 unsigned geom1 = scene.addQuadSphere (sampler,RTC_BUILD_QUALITY_MEDIUM,Vec3fa(-1,0,+1),1.0f,50).first;
1661 unsigned geom2 = scene.addSubdivSphere(sampler,RTC_BUILD_QUALITY_MEDIUM,Vec3fa(+1,0,-1),1.0f,5,4).first;
1662 unsigned geom3 = scene.addHair (sampler,RTC_BUILD_QUALITY_MEDIUM,Vec3fa(+1,0,+1),1.0f,1.0f,1).first;
1663 RTCGeometry hgeom0 = rtcGetGeometry(scene,geom0);
1664 RTCGeometry hgeom1 = rtcGetGeometry(scene,geom1);
1665 RTCGeometry hgeom2 = rtcGetGeometry(scene,geom2);
1666 RTCGeometry hgeom3 = rtcGetGeometry(scene,geom3);
1667 AssertNoError(device);
1668
1669 for (size_t i=0; i<17; i++)
1670 {
1671 bool enabled0 = i & 1, enabled1 = i & 2, enabled2 = i & 4, enabled3 = i & 8;
1672 if (enabled0) rtcEnableGeometry(hgeom0); else rtcDisableGeometry(hgeom0); AssertNoError(device);
1673 if (enabled1) rtcEnableGeometry(hgeom1); else rtcDisableGeometry(hgeom1); AssertNoError(device);
1674 if (enabled2) rtcEnableGeometry(hgeom2); else rtcDisableGeometry(hgeom2); AssertNoError(device);
1675 if (enabled3) rtcEnableGeometry(hgeom3); else rtcDisableGeometry(hgeom3); AssertNoError(device);
1676 rtcCommitScene (scene);
1677 AssertNoError(device);
1678 {
1679 RTCRayHit ray0 = makeRay(Vec3fa(-1,10,-1),Vec3fa(0,-1,0));
1680 RTCRayHit ray1 = makeRay(Vec3fa(-1,10,+1),Vec3fa(0,-1,0));
1681 RTCRayHit ray2 = makeRay(Vec3fa(+1,10,-1),Vec3fa(0,-1,0));
1682 RTCRayHit ray3 = makeRay(Vec3fa(+1,10,+1),Vec3fa(0,-1,0));
1683 rtcIntersect1(scene,&ray0);
1684 rtcIntersect1(scene,&ray1);
1685 rtcIntersect1(scene,&ray2);
1686 rtcIntersect1(scene,&ray3);
1687 bool ok0 = enabled0 ? ray0.hit.geomID == 0 : ray0.hit.geomID == RTC_INVALID_GEOMETRY_ID;
1688 bool ok1 = enabled1 ? ray1.hit.geomID == 1 : ray1.hit.geomID == RTC_INVALID_GEOMETRY_ID;
1689 bool ok2 = enabled2 ? ray2.hit.geomID == 2 : ray2.hit.geomID == RTC_INVALID_GEOMETRY_ID;
1690 bool ok3 = enabled3 ? ray3.hit.geomID == 3 : ray3.hit.geomID == RTC_INVALID_GEOMETRY_ID;
1691 if (!ok0 || !ok1 || !ok2 || !ok3) return VerifyApplication::FAILED;
1692 }
1693 }
1694 AssertNoError(device);
1695
1696 return VerifyApplication::PASSED;
1697 }
1698 };
1699
1700 struct DisableAndDetachGeometryTest : public VerifyApplication::Test

Callers

nothing calls this directly

Calls 15

stringOfISAFunction · 0.85
rtcNewDeviceFunction · 0.85
errorHandlerFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
AssertNoErrorFunction · 0.85
rtcEnableGeometryFunction · 0.85
rtcDisableGeometryFunction · 0.85
rtcCommitSceneFunction · 0.85
makeRayFunction · 0.85
rtcIntersect1Function · 0.85
addSphereMethod · 0.80
addQuadSphereMethod · 0.80

Tested by

no test coverage detected