| 2785 | } |
| 2786 | |
| 2787 | VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent) |
| 2788 | { |
| 2789 | std::string cfg = state->rtcore + ",isa="+stringOfISA(isa); |
| 2790 | RTCDeviceRef device = rtcNewDevice(cfg.c_str()); |
| 2791 | errorHandler(nullptr,rtcGetDeviceError(device)); |
| 2792 | |
| 2793 | VerifyScene scene(device,sflags); |
| 2794 | Vec3fa p0(-0.75f,-0.25f,-10.0f), dx(4,0,0), dy(0,4,0); |
| 2795 | unsigned int geomID0 = 0; |
| 2796 | if (subdiv) geomID0 = scene.addSubdivPlane (sampler,quality, 4, p0, dx, dy).first; |
| 2797 | else geomID0 = scene.addPlane (sampler,quality, 4, p0, dx, dy).first; |
| 2798 | RTCGeometry geom0 = rtcGetGeometry(scene,geomID0); |
| 2799 | rtcSetGeometryUserData(geom0,(void*)123); |
| 2800 | rtcSetGeometryIntersectFilterFunction (geom0,intersectionFilterN); |
| 2801 | rtcSetGeometryOccludedFilterFunction (geom0,intersectionFilterN); |
| 2802 | rtcCommitScene (scene); |
| 2803 | AssertNoError(device); |
| 2804 | |
| 2805 | RTCRayHit rays[16]; |
| 2806 | for (unsigned int iy=0; iy<4; iy++) |
| 2807 | { |
| 2808 | for (unsigned int ix=0; ix<4; ix++) |
| 2809 | { |
| 2810 | //unsigned int primID = iy*4+ix; |
| 2811 | //if (!subdiv) primID *= 2; |
| 2812 | rays[iy*4+ix] = makeRay(Vec3fa(float(ix),float(iy),0.0f),Vec3fa(0,0,-1)); |
| 2813 | } |
| 2814 | } |
| 2815 | IntersectWithMode(imode,ivariant,scene,rays,16); |
| 2816 | |
| 2817 | bool passed = true; |
| 2818 | for (unsigned int iy=0; iy<4; iy++) |
| 2819 | { |
| 2820 | for (unsigned int ix=0; ix<4; ix++) |
| 2821 | { |
| 2822 | unsigned int primID = iy*4+ix; |
| 2823 | if (!subdiv) primID *= 2; |
| 2824 | RTCRayHit& ray = rays[iy*4+ix]; |
| 2825 | bool ok = true; |
| 2826 | if (ivariant & VARIANT_INTERSECT) |
| 2827 | ok = (primID & 2) ? (ray.hit.geomID == RTC_INVALID_GEOMETRY_ID) : (ray.hit.geomID == 0); |
| 2828 | else |
| 2829 | ok = ((primID & 2) != 0) == (ray.ray.tfar != float(neg_inf)); |
| 2830 | if (!ok) passed = false; |
| 2831 | } |
| 2832 | } |
| 2833 | AssertNoError(device); |
| 2834 | |
| 2835 | return (VerifyApplication::TestReturnValue) passed; |
| 2836 | } |
| 2837 | }; |
| 2838 | |
| 2839 | struct InstancingTest : public VerifyApplication::IntersectTest |
nothing calls this directly
no test coverage detected