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

Method run

tutorials/verify/verify.cpp:2874–2939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2872 }
2873
2874 VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent)
2875 {
2876 std::string cfg = state->rtcore + ",isa="+stringOfISA(isa);
2877 RTCDeviceRef device = rtcNewDevice(cfg.c_str());
2878 errorHandler(nullptr,rtcGetDeviceError(device));
2879
2880 Ref<SceneGraph::Node> child;
2881 Ref<SceneGraph::Node> parent;
2882 if (subdiv)
2883 child = SceneGraph::createSubdivSphere(Vec3fa(0.f), 1.f, 32, 2.f);
2884 else
2885 child = SceneGraph::createQuadSphere(Vec3fa(0.f), 1.f, 32);
2886
2887 for (int i = 0; i < RTC_MAX_INSTANCE_LEVEL_COUNT; ++i)
2888 {
2889 parent = new SceneGraph::TransformNode(AffineSpace3fa(one), child);
2890 child = parent;
2891 }
2892
2893 sflags.sflags = sflags.sflags | RTC_SCENE_FLAG_FILTER_FUNCTION_IN_ARGUMENTS;
2894
2895 RayQueryContext ctx;
2896 rtcInitRayQueryContext(&ctx.context);
2897
2898 RTCIntersectArguments args;
2899 rtcInitIntersectArguments(&args);
2900 args.context = &ctx.context;
2901 args.filter = intersectFilter;
2902 args.flags = RTC_RAY_QUERY_FLAG_INVOKE_ARGUMENT_FILTER;
2903
2904 VerifyScene scene(device, sflags);
2905 scene.addGeometry(quality, parent);
2906 rtcCommitScene(scene);
2907 AssertNoError(device);
2908
2909 RTCRayHit rays[16];
2910 for (unsigned int iy=0; iy<4; iy++)
2911 {
2912 for (unsigned int ix=0; ix<4; ix++)
2913 {
2914 const int id = iy*4+ix;
2915 rays[id] = makeRay(Vec3fa(float(ix)/10.f,float(iy)/10.f,-2.0f),Vec3fa(0,0,1));
2916 rays[id].ray.id = id;
2917 ctx.numHits[id] = 0;
2918 }
2919 }
2920 IntersectWithMode(imode,ivariant,scene,rays,16,&args);
2921 bool passed = true;
2922 for (unsigned int iy=0; iy<4; iy++)
2923 {
2924 for (unsigned int ix=0; ix<4; ix++)
2925 {
2926 const unsigned id = iy*4+ix;
2927 passed &= (ctx.numHits[id] > 0);
2928 RTCRayHit& ray = rays[id];
2929 if (ivariant & VARIANT_INTERSECT)
2930 passed &= (ray.hit.geomID != RTC_INVALID_GEOMETRY_ID);
2931 else

Callers

nothing calls this directly

Calls 13

stringOfISAFunction · 0.85
rtcNewDeviceFunction · 0.85
errorHandlerFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
rtcInitRayQueryContextFunction · 0.85
rtcCommitSceneFunction · 0.85
AssertNoErrorFunction · 0.85
makeRayFunction · 0.85
IntersectWithModeFunction · 0.85
addGeometryMethod · 0.80
Vec3faClass · 0.50

Tested by

no test coverage detected