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

Function rtcIntersect16

kernels/common/rtcore.cpp:858–901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

856 }
857
858 RTC_API void rtcIntersect16 (const int* valid, RTCScene hscene, RTCRayHit16* rayhit, RTCIntersectArguments* args)
859 {
860 Scene* scene = (Scene*) hscene;
861 RTC_CATCH_BEGIN;
862 RTC_TRACE(rtcIntersect16);
863
864#if defined(DEBUG)
865 RTC_VERIFY_HANDLE(hscene);
866 if (scene->isModified()) throw_RTCError(RTC_ERROR_INVALID_OPERATION,"scene not committed");
867 if (((size_t)valid) & 0x3F) throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "mask not aligned to 64 bytes");
868 if (((size_t)rayhit) & 0x3F) throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "rayhit not aligned to 64 bytes");
869#endif
870 STAT(size_t cnt=0; for (size_t i=0; i<16; i++) cnt += ((int*)valid)[i] == -1;);
871 STAT3(normal.travs,cnt,cnt,cnt);
872
873 RTCIntersectArguments defaultArgs;
874 if (unlikely(args == nullptr)) {
875 rtcInitIntersectArguments(&defaultArgs);
876 args = &defaultArgs;
877 }
878 RTCRayQueryContext* user_context = args->context;
879
880 RTCRayQueryContext defaultContext;
881 if (unlikely(user_context == nullptr)) {
882 rtcInitRayQueryContext(&defaultContext);
883 user_context = &defaultContext;
884 }
885 RayQueryContext context(scene,user_context,args);
886
887 if (likely(scene->intersectors.intersector16))
888 scene->intersectors.intersect16(valid,*rayhit,&context);
889
890 else {
891 RayHit16* ray16 = (RayHit16*) rayhit;
892 for (size_t i=0; i<16; i++) {
893 if (!valid[i]) continue;
894 RayHit ray1; ray16->get(i,ray1);
895 scene->intersectors.intersect((RTCRayHit&)ray1,&context);
896 ray16->set(i,ray1);
897 }
898 }
899
900 RTC_CATCH_END2(scene);
901 }
902
903 RTC_API void rtcForwardIntersect16(const int* valid, const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay16* iray, unsigned int instID)
904 {

Callers 4

render_blockMethod · 0.85
render_blockMethod · 0.85

Calls 7

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

Tested by

no test coverage detected