| 1705 | : VerifyApplication::Test(name,isa,VerifyApplication::TEST_SHOULD_PASS), sflags(sflags) {} |
| 1706 | |
| 1707 | VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent) |
| 1708 | { |
| 1709 | std::string cfg = state->rtcore + ",isa="+stringOfISA(isa); |
| 1710 | RTCDeviceRef device = rtcNewDevice(cfg.c_str()); |
| 1711 | errorHandler(nullptr,rtcGetDeviceError(device)); |
| 1712 | VerifyScene scene(device,sflags); |
| 1713 | AssertNoError(device); |
| 1714 | unsigned geom[] = { |
| 1715 | scene.addSphere (sampler,RTC_BUILD_QUALITY_MEDIUM,Vec3fa(-1,0,-1),1.0f,50).first, |
| 1716 | scene.addQuadSphere (sampler,RTC_BUILD_QUALITY_MEDIUM,Vec3fa(-1,0,+1),1.0f,50).first, |
| 1717 | scene.addSubdivSphere(sampler,RTC_BUILD_QUALITY_MEDIUM,Vec3fa(+1,0,-1),1.0f,5,4).first, |
| 1718 | scene.addHair (sampler,RTC_BUILD_QUALITY_MEDIUM,Vec3fa(+1,0,+1),1.0f,1.0f,1).first, |
| 1719 | }; |
| 1720 | RTCGeometry hgeom[] = { |
| 1721 | rtcGetGeometry(scene,geom[0]), |
| 1722 | rtcGetGeometry(scene,geom[1]), |
| 1723 | rtcGetGeometry(scene,geom[2]), |
| 1724 | rtcGetGeometry(scene,geom[3]), |
| 1725 | }; |
| 1726 | AssertNoError(device); |
| 1727 | |
| 1728 | for (size_t j=0; j<4; ++j) |
| 1729 | { |
| 1730 | rtcEnableGeometry(hgeom[j]); |
| 1731 | } |
| 1732 | rtcCommitScene (scene); |
| 1733 | AssertNoError(device); |
| 1734 | |
| 1735 | bool allOk = true; |
| 1736 | for (size_t i=0; i<5; i++) |
| 1737 | { |
| 1738 | RTCRayHit ray0 = makeRay(Vec3fa(-1,10,-1),Vec3fa(0,-1,0)); |
| 1739 | RTCRayHit ray1 = makeRay(Vec3fa(-1,10,+1),Vec3fa(0,-1,0)); |
| 1740 | RTCRayHit ray2 = makeRay(Vec3fa(+1,10,-1),Vec3fa(0,-1,0)); |
| 1741 | RTCRayHit ray3 = makeRay(Vec3fa(+1,10,+1),Vec3fa(0,-1,0)); |
| 1742 | rtcIntersect1(scene,&ray0); |
| 1743 | rtcIntersect1(scene,&ray1); |
| 1744 | rtcIntersect1(scene,&ray2); |
| 1745 | rtcIntersect1(scene,&ray3); |
| 1746 | bool ok0 = i<=0 ? ray0.hit.geomID == 0 : ray0.hit.geomID == RTC_INVALID_GEOMETRY_ID; |
| 1747 | bool ok1 = i<=1 ? ray1.hit.geomID == 1 : ray1.hit.geomID == RTC_INVALID_GEOMETRY_ID; |
| 1748 | bool ok2 = i<=2 ? ray2.hit.geomID == 2 : ray2.hit.geomID == RTC_INVALID_GEOMETRY_ID; |
| 1749 | bool ok3 = i<=3 ? ray3.hit.geomID == 3 : ray3.hit.geomID == RTC_INVALID_GEOMETRY_ID; |
| 1750 | if (!ok0 || !ok1 || !ok2 || !ok3) |
| 1751 | { |
| 1752 | std::cout << "!" << std::flush; |
| 1753 | allOk = false; |
| 1754 | } |
| 1755 | else |
| 1756 | { |
| 1757 | std::cout << "." << std::flush; |
| 1758 | } |
| 1759 | |
| 1760 | if (i<4) |
| 1761 | { |
| 1762 | rtcDisableGeometry(hgeom[i]); |
| 1763 | AssertNoError(device); |
| 1764 | rtcDetachGeometry(scene,geom[i]); |
nothing calls this directly
no test coverage detected