diff options
Diffstat (limited to 'thirdparty/embree/kernels/geometry/intersector_epilog.h')
-rw-r--r-- | thirdparty/embree/kernels/geometry/intersector_epilog.h | 88 |
1 files changed, 56 insertions, 32 deletions
diff --git a/thirdparty/embree/kernels/geometry/intersector_epilog.h b/thirdparty/embree/kernels/geometry/intersector_epilog.h index 7bf134cc54..af85b0e57d 100644 --- a/thirdparty/embree/kernels/geometry/intersector_epilog.h +++ b/thirdparty/embree/kernels/geometry/intersector_epilog.h @@ -21,12 +21,12 @@ namespace embree struct Intersect1Epilog1 { RayHit& ray; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline Intersect1Epilog1(RayHit& ray, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : ray(ray), context(context), geomID(geomID), primID(primID) {} @@ -64,6 +64,9 @@ namespace embree ray.primID = primID; ray.geomID = geomID; instance_id_stack::copy_UU(context->user->instID, ray.instID); +#if defined(RTC_GEOMETRY_INSTANCE_ARRAY) + instance_id_stack::copy_UU(context->user->instPrimID, ray.instPrimID); +#endif return true; } }; @@ -72,12 +75,12 @@ namespace embree struct Occluded1Epilog1 { Ray& ray; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline Occluded1Epilog1(Ray& ray, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : ray(ray), context(context), geomID(geomID), primID(primID) {} @@ -117,12 +120,12 @@ namespace embree { RayHitK<K>& ray; size_t k; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline Intersect1KEpilog1(RayHitK<K>& ray, size_t k, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : ray(ray), k(k), context(context), geomID(geomID), primID(primID) {} @@ -163,6 +166,9 @@ namespace embree ray.primID[k] = primID; ray.geomID[k] = geomID; instance_id_stack::copy_UV<K>(context->user->instID, ray.instID, k); +#if defined(RTC_GEOMETRY_INSTANCE_ARRAY) + instance_id_stack::copy_UV<K>(context->user->instPrimID, ray.instPrimID, k); +#endif return true; } }; @@ -172,12 +178,12 @@ namespace embree { RayK<K>& ray; size_t k; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline Occluded1KEpilog1(RayK<K>& ray, size_t k, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : ray(ray), k(k), context(context), geomID(geomID), primID(primID) {} @@ -215,12 +221,12 @@ namespace embree struct Intersect1EpilogM { RayHit& ray; - IntersectContext* context; + RayQueryContext* context; const vuint<M>& geomIDs; const vuint<M>& primIDs; __forceinline Intersect1EpilogM(RayHit& ray, - IntersectContext* context, + RayQueryContext* context, const vuint<M>& geomIDs, const vuint<M>& primIDs) : ray(ray), context(context), geomIDs(geomIDs), primIDs(primIDs) {} @@ -287,6 +293,9 @@ namespace embree ray.primID = primIDs[i]; ray.geomID = geomID; instance_id_stack::copy_UU(context->user->instID, ray.instID); +#if defined(RTC_GEOMETRY_INSTANCE_ARRAY) + instance_id_stack::copy_UU(context->user->instPrimID, ray.instPrimID); +#endif return true; } @@ -296,12 +305,12 @@ namespace embree struct Occluded1EpilogM { Ray& ray; - IntersectContext* context; + RayQueryContext* context; const vuint<M>& geomIDs; const vuint<M>& primIDs; __forceinline Occluded1EpilogM(Ray& ray, - IntersectContext* context, + RayQueryContext* context, const vuint<M>& geomIDs, const vuint<M>& primIDs) : ray(ray), context(context), geomIDs(geomIDs), primIDs(primIDs) {} @@ -363,12 +372,12 @@ namespace embree struct Intersect1EpilogMU { RayHit& ray; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline Intersect1EpilogMU(RayHit& ray, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : ray(ray), context(context), geomID(geomID), primID(primID) {} @@ -424,6 +433,9 @@ namespace embree ray.primID = primID; ray.geomID = geomID; instance_id_stack::copy_UU(context->user->instID, ray.instID); +#if defined(RTC_GEOMETRY_INSTANCE_ARRAY) + instance_id_stack::copy_UU(context->user->instPrimID, ray.instPrimID); +#endif return true; } }; @@ -432,12 +444,12 @@ namespace embree struct Occluded1EpilogMU { Ray& ray; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline Occluded1EpilogMU(Ray& ray, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : ray(ray), context(context), geomID(geomID), primID(primID) {} @@ -477,13 +489,13 @@ namespace embree struct IntersectKEpilogM { RayHitK<K>& ray; - IntersectContext* context; + RayQueryContext* context; const vuint<M>& geomIDs; const vuint<M>& primIDs; const size_t i; __forceinline IntersectKEpilogM(RayHitK<K>& ray, - IntersectContext* context, + RayQueryContext* context, const vuint<M>& geomIDs, const vuint<M>& primIDs, size_t i) @@ -534,6 +546,9 @@ namespace embree vuint<K>::store(valid,&ray.primID,primID); vuint<K>::store(valid,&ray.geomID,geomID); instance_id_stack::copy_UV<K>(context->user->instID, ray.instID, valid); +#if defined(RTC_GEOMETRY_INSTANCE_ARRAY) + instance_id_stack::copy_UV<K>(context->user->instPrimID, ray.instPrimID, valid); +#endif return valid; } }; @@ -543,14 +558,14 @@ namespace embree { vbool<K>& valid0; RayK<K>& ray; - IntersectContext* context; + RayQueryContext* context; const vuint<M>& geomIDs; const vuint<M>& primIDs; const size_t i; __forceinline OccludedKEpilogM(vbool<K>& valid0, RayK<K>& ray, - IntersectContext* context, + RayQueryContext* context, const vuint<M>& geomIDs, const vuint<M>& primIDs, size_t i) @@ -598,12 +613,12 @@ namespace embree struct IntersectKEpilogMU { RayHitK<K>& ray; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline IntersectKEpilogMU(RayHitK<K>& ray, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : ray(ray), context(context), geomID(geomID), primID(primID) {} @@ -649,6 +664,9 @@ namespace embree vuint<K>::store(valid,&ray.primID,primID); vuint<K>::store(valid,&ray.geomID,geomID); instance_id_stack::copy_UV<K>(context->user->instID, ray.instID, valid); +#if defined(RTC_GEOMETRY_INSTANCE_ARRAY) + instance_id_stack::copy_UV<K>(context->user->instPrimID, ray.instPrimID, valid); +#endif return valid; } }; @@ -658,13 +676,13 @@ namespace embree { vbool<K>& valid0; RayK<K>& ray; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline OccludedKEpilogMU(vbool<K>& valid0, RayK<K>& ray, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : valid0(valid0), ray(ray), context(context), geomID(geomID), primID(primID) {} @@ -709,12 +727,12 @@ namespace embree { RayHitK<K>& ray; size_t k; - IntersectContext* context; + RayQueryContext* context; const vuint<M>& geomIDs; const vuint<M>& primIDs; __forceinline Intersect1KEpilogM(RayHitK<K>& ray, size_t k, - IntersectContext* context, + RayQueryContext* context, const vuint<M>& geomIDs, const vuint<M>& primIDs) : ray(ray), k(k), context(context), geomIDs(geomIDs), primIDs(primIDs) {} @@ -783,6 +801,9 @@ namespace embree ray.primID[k] = primIDs[i]; ray.geomID[k] = geomID; instance_id_stack::copy_UV<K>(context->user->instID, ray.instID, k); +#if defined(RTC_GEOMETRY_INSTANCE_ARRAY) + instance_id_stack::copy_UV<K>(context->user->instPrimID, ray.instPrimID, k); +#endif return true; } }; @@ -792,12 +813,12 @@ namespace embree { RayK<K>& ray; size_t k; - IntersectContext* context; + RayQueryContext* context; const vuint<M>& geomIDs; const vuint<M>& primIDs; __forceinline Occluded1KEpilogM(RayK<K>& ray, size_t k, - IntersectContext* context, + RayQueryContext* context, const vuint<M>& geomIDs, const vuint<M>& primIDs) : ray(ray), k(k), context(context), geomIDs(geomIDs), primIDs(primIDs) {} @@ -860,12 +881,12 @@ namespace embree { RayHitK<K>& ray; size_t k; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline Intersect1KEpilogMU(RayHitK<K>& ray, size_t k, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : ray(ray), k(k), context(context), geomID(geomID), primID(primID) {} @@ -923,6 +944,9 @@ namespace embree ray.primID[k] = primID; ray.geomID[k] = geomID; instance_id_stack::copy_UV<K>(context->user->instID, ray.instID, k); +#if defined(RTC_GEOMETRY_INSTANCE_ARRAY) + instance_id_stack::copy_UV<K>(context->user->instPrimID, ray.instPrimID, k); +#endif return true; } }; @@ -932,12 +956,12 @@ namespace embree { RayK<K>& ray; size_t k; - IntersectContext* context; + RayQueryContext* context; const unsigned int geomID; const unsigned int primID; __forceinline Occluded1KEpilogMU(RayK<K>& ray, size_t k, - IntersectContext* context, + RayQueryContext* context, const unsigned int geomID, const unsigned int primID) : ray(ray), k(k), context(context), geomID(geomID), primID(primID) {} |