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

Function rtcIntersect8

kernels/common/rtcore.cpp:797–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795 }
796
797 RTC_API void rtcIntersect8 (const int* valid, RTCScene hscene, RTCRayHit8* rayhit, RTCIntersectArguments* args)
798 {
799 Scene* scene = (Scene*) hscene;
800 RTC_CATCH_BEGIN;
801 RTC_TRACE(rtcIntersect8);
802
803#if defined(DEBUG)
804 RTC_VERIFY_HANDLE(hscene);
805 if (scene->isModified()) throw_RTCError(RTC_ERROR_INVALID_OPERATION,"scene not committed");
806 if (((size_t)valid) & 0x1F) throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "mask not aligned to 32 bytes");
807 if (((size_t)rayhit) & 0x1F) throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "rayhit not aligned to 32 bytes");
808#endif
809 STAT(size_t cnt=0; for (size_t i=0; i<8; i++) cnt += ((int*)valid)[i] == -1;);
810 STAT3(normal.travs,cnt,cnt,cnt);
811
812 RTCIntersectArguments defaultArgs;
813 if (unlikely(args == nullptr)) {
814 rtcInitIntersectArguments(&defaultArgs);
815 args = &defaultArgs;
816 }
817 RTCRayQueryContext* user_context = args->context;
818
819 RTCRayQueryContext defaultContext;
820 if (unlikely(user_context == nullptr)) {
821 rtcInitRayQueryContext(&defaultContext);
822 user_context = &defaultContext;
823 }
824 RayQueryContext context(scene,user_context,args);
825
826 if (likely(scene->intersectors.intersector8))
827 scene->intersectors.intersect8(valid,*rayhit,&context);
828
829 else
830 {
831 RayHit8* ray8 = (RayHit8*) rayhit;
832 for (size_t i=0; i<8; i++) {
833 if (!valid[i]) continue;
834 RayHit ray1; ray8->get(i,ray1);
835 scene->intersectors.intersect((RTCRayHit&)ray1,&context);
836 ray8->set(i,ray1);
837 }
838 }
839
840 RTC_CATCH_END2(scene);
841 }
842
843 RTC_API void rtcForwardIntersect8(const int* valid, const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay8* iray, unsigned int instID)
844 {

Callers 4

rtcTraversableIntersect8Function · 0.85
render_blockMethod · 0.85
render_blockMethod · 0.85

Calls 7

rtcInitRayQueryContextFunction · 0.85
isModifiedMethod · 0.80
intersect8Method · 0.45
getMethod · 0.45
intersectMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected