diff options
Diffstat (limited to 'thirdparty/embree/kernels/geometry/curveNi_mb_intersector.h')
-rw-r--r-- | thirdparty/embree/kernels/geometry/curveNi_mb_intersector.h | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/thirdparty/embree/kernels/geometry/curveNi_mb_intersector.h b/thirdparty/embree/kernels/geometry/curveNi_mb_intersector.h index bab796b33b..4c14c2f004 100644 --- a/thirdparty/embree/kernels/geometry/curveNi_mb_intersector.h +++ b/thirdparty/embree/kernels/geometry/curveNi_mb_intersector.h @@ -6,6 +6,12 @@ #include "curveNi_mb.h" #include "../subdiv/linear_bezier_patch.h" +#include "roundline_intersector.h" +#include "coneline_intersector.h" +#include "curve_intersector_ribbon.h" +#include "curve_intersector_oriented.h" +#include "curve_intersector_sweep.h" + namespace embree { namespace isa @@ -21,9 +27,14 @@ namespace embree static __forceinline vbool<M> intersect(Ray& ray, const Primitive& prim, vfloat<M>& tNear_o) { const size_t N = prim.N; +#if __SYCL_DEVICE_ONLY__ + const Vec3f offset = *prim.offset(N); + const float scale = *prim.scale(N); +#else const vfloat4 offset_scale = vfloat4::loadu(prim.offset(N)); const Vec3fa offset = Vec3fa(offset_scale); const Vec3fa scale = Vec3fa(shuffle<3,3,3,3>(offset_scale)); +#endif const Vec3fa org1 = (ray.org-offset)*scale; const Vec3fa dir1 = ray.dir*scale; @@ -73,7 +84,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline void intersect_t(const Precalculations& pre, RayHit& ray, IntersectContext* context, const Primitive& prim) + static __forceinline void intersect_t(const Precalculations& pre, RayHit& ray, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,prim,tNear); @@ -95,7 +106,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline bool occluded_t(const Precalculations& pre, Ray& ray, IntersectContext* context, const Primitive& prim) + static __forceinline bool occluded_t(const Precalculations& pre, Ray& ray, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,prim,tNear); @@ -120,7 +131,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline void intersect_n(const Precalculations& pre, RayHit& ray, IntersectContext* context, const Primitive& prim) + static __forceinline void intersect_n(const Precalculations& pre, RayHit& ray, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,prim,tNear); @@ -141,7 +152,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline bool occluded_n(const Precalculations& pre, Ray& ray, IntersectContext* context, const Primitive& prim) + static __forceinline bool occluded_n(const Precalculations& pre, Ray& ray, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,prim,tNear); @@ -166,7 +177,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline void intersect_h(const Precalculations& pre, RayHit& ray, IntersectContext* context, const Primitive& prim) + static __forceinline void intersect_h(const Precalculations& pre, RayHit& ray, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,prim,tNear); @@ -187,7 +198,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline bool occluded_h(const Precalculations& pre, Ray& ray, IntersectContext* context, const Primitive& prim) + static __forceinline bool occluded_h(const Precalculations& pre, Ray& ray, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,prim,tNear); @@ -211,7 +222,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline void intersect_hn(const Precalculations& pre, RayHit& ray, IntersectContext* context, const Primitive& prim) + static __forceinline void intersect_hn(const Precalculations& pre, RayHit& ray, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,prim,tNear); @@ -232,7 +243,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline bool occluded_hn(const Precalculations& pre, Ray& ray, IntersectContext* context, const Primitive& prim) + static __forceinline bool occluded_hn(const Precalculations& pre, Ray& ray, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,prim,tNear); @@ -267,10 +278,14 @@ namespace embree static __forceinline vbool<M> intersect(RayK<K>& ray, const size_t k, const Primitive& prim, vfloat<M>& tNear_o) { const size_t N = prim.N; +#if __SYCL_DEVICE_ONLY__ + const Vec3f offset = *prim.offset(N); + const float scale = *prim.scale(N); +#else const vfloat4 offset_scale = vfloat4::loadu(prim.offset(N)); const Vec3fa offset = Vec3fa(offset_scale); const Vec3fa scale = Vec3fa(shuffle<3,3,3,3>(offset_scale)); - +#endif const Vec3fa ray_org(ray.org.x[k],ray.org.y[k],ray.org.z[k]); const Vec3fa ray_dir(ray.dir.x[k],ray.dir.y[k],ray.dir.z[k]); const Vec3fa org1 = (ray_org-offset)*scale; @@ -322,7 +337,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline void intersect_t(Precalculations& pre, RayHitK<K>& ray, const size_t k, IntersectContext* context, const Primitive& prim) + static __forceinline void intersect_t(Precalculations& pre, RayHitK<K>& ray, const size_t k, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; @@ -345,7 +360,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline bool occluded_t(Precalculations& pre, RayK<K>& ray, const size_t k, IntersectContext* context, const Primitive& prim) + static __forceinline bool occluded_t(Precalculations& pre, RayK<K>& ray, const size_t k, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,k,prim,tNear); @@ -370,7 +385,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline void intersect_n(Precalculations& pre, RayHitK<K>& ray, const size_t k, IntersectContext* context, const Primitive& prim) + static __forceinline void intersect_n(Precalculations& pre, RayHitK<K>& ray, const size_t k, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; @@ -393,7 +408,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline bool occluded_n(Precalculations& pre, RayK<K>& ray, const size_t k, IntersectContext* context, const Primitive& prim) + static __forceinline bool occluded_n(Precalculations& pre, RayK<K>& ray, const size_t k, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,k,prim,tNear); @@ -419,7 +434,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline void intersect_h(Precalculations& pre, RayHitK<K>& ray, const size_t k, IntersectContext* context, const Primitive& prim) + static __forceinline void intersect_h(Precalculations& pre, RayHitK<K>& ray, const size_t k, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; @@ -441,7 +456,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline bool occluded_h(Precalculations& pre, RayK<K>& ray, const size_t k, IntersectContext* context, const Primitive& prim) + static __forceinline bool occluded_h(Precalculations& pre, RayK<K>& ray, const size_t k, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,k,prim,tNear); @@ -465,7 +480,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline void intersect_hn(Precalculations& pre, RayHitK<K>& ray, const size_t k, IntersectContext* context, const Primitive& prim) + static __forceinline void intersect_hn(Precalculations& pre, RayHitK<K>& ray, const size_t k, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; @@ -488,7 +503,7 @@ namespace embree } template<typename Intersector, typename Epilog> - static __forceinline bool occluded_hn(Precalculations& pre, RayK<K>& ray, const size_t k, IntersectContext* context, const Primitive& prim) + static __forceinline bool occluded_hn(Precalculations& pre, RayK<K>& ray, const size_t k, RayQueryContext* context, const Primitive& prim) { vfloat<M> tNear; vbool<M> valid = intersect(ray,k,prim,tNear); |