acceln.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // ======================================================================== //
  2. // Copyright 2009-2017 Intel Corporation //
  3. // //
  4. // Licensed under the Apache License, Version 2.0 (the "License"); //
  5. // you may not use this file except in compliance with the License. //
  6. // You may obtain a copy of the License at //
  7. // //
  8. // http://www.apache.org/licenses/LICENSE-2.0 //
  9. // //
  10. // Unless required by applicable law or agreed to in writing, software //
  11. // distributed under the License is distributed on an "AS IS" BASIS, //
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
  13. // See the License for the specific language governing permissions and //
  14. // limitations under the License. //
  15. // ======================================================================== //
  16. #pragma once
  17. #include "accel.h"
  18. namespace embree
  19. {
  20. /*! merges N acceleration structures together, by processing them in order */
  21. class AccelN : public Accel
  22. {
  23. public:
  24. AccelN ();
  25. ~AccelN();
  26. public:
  27. void add(Accel* accel);
  28. public:
  29. static void intersect (void* ptr, RTCRay& ray, IntersectContext* context);
  30. static void intersect4 (const void* valid, void* ptr, RTCRay4& ray, IntersectContext* context);
  31. static void intersect8 (const void* valid, void* ptr, RTCRay8& ray, IntersectContext* context);
  32. static void intersect16 (const void* valid, void* ptr, RTCRay16& ray, IntersectContext* context);
  33. static void intersectN (void* ptr, RTCRay** ray, const size_t N, IntersectContext* context);
  34. public:
  35. static void occluded (void* ptr, RTCRay& ray, IntersectContext* context);
  36. static void occluded4 (const void* valid, void* ptr, RTCRay4& ray, IntersectContext* context);
  37. static void occluded8 (const void* valid, void* ptr, RTCRay8& ray, IntersectContext* context);
  38. static void occluded16 (const void* valid, void* ptr, RTCRay16& ray, IntersectContext* context);
  39. static void occludedN (void* ptr, RTCRay** ray, const size_t N, IntersectContext* context);
  40. public:
  41. void print(size_t ident);
  42. void immutable();
  43. void build ();
  44. void select(bool filter4, bool filter8, bool filter16, bool filterN);
  45. void deleteGeometry(size_t geomID);
  46. void clear ();
  47. __forceinline bool validIsecN() { return validIntersectorN; }
  48. public:
  49. darray_t<Accel*,16> accels;
  50. darray_t<Accel*,16> validAccels;
  51. bool validIntersectorN;
  52. };
  53. }