rtcJoinCommitScene.3embree3 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. .TH "rtcJoinCommitScene" "3" "" "" "Embree Ray Tracing Kernels 3"
  2. .SS NAME
  3. .IP
  4. .nf
  5. \f[C]
  6. rtcJoinCommitScene\ \-\ commits\ the\ scene\ from\ multiple\ threads
  7. \f[]
  8. .fi
  9. .SS SYNOPSIS
  10. .IP
  11. .nf
  12. \f[C]
  13. #include\ <embree3/rtcore.h>
  14. void\ rtcJoinCommitScene(RTCScene\ scene);
  15. \f[]
  16. .fi
  17. .SS DESCRIPTION
  18. .PP
  19. The \f[C]rtcJoinCommitScene\f[] function commits all changes for the
  20. specified scene (\f[C]scene\f[] argument).
  21. In contrast to the \f[C]rtcCommitScene\f[] function, the
  22. \f[C]rtcJoinCommitScene\f[] function can be called from multiple
  23. threads, which all cooperate in the same scene commit.
  24. All threads will return from this function after the scene commit is
  25. finished.
  26. All threads must consistently call \f[C]rtcJoinCommitScene\f[] and not
  27. \f[C]rtcCommitScene\f[].
  28. .PP
  29. The scene commit internally triggers building of a spatial acceleration
  30. structure for the scene.
  31. Ray queries can be performed after scene changes got properly committed.
  32. .PP
  33. The \f[C]rtcJoinCommitScene\f[] feature allows a flexible way to lazily
  34. create hierarchies during rendering.
  35. A thread reaching a not\-yet\-constructed sub\-scene of a two\-level
  36. scene can generate the sub\-scene geometry and call
  37. \f[C]rtcJoinCommitScene\f[] on that just generated scene.
  38. During construction, further threads reaching the not\-yet\-built scene
  39. can join the build operation by also invoking
  40. \f[C]rtcJoinCommitScene\f[].
  41. A thread that calls \f[C]rtcJoinCommitScene\f[] after the build finishes
  42. will directly return from the \f[C]rtcJoinCommitScene\f[] call.
  43. .PP
  44. Multiple scene commit operations on different scenes can be running at
  45. the same time, hence it is possible to commit many small scenes in
  46. parallel, distributing the commits to many threads.
  47. .PP
  48. When using Embree with the Intel® Threading Building Blocks (which is
  49. the default), threads that call \f[C]rtcJoinCommitScene\f[] will join
  50. the build operation, but other TBB worker threads might also participate
  51. in the build.
  52. To avoid thread oversubscription, we recommend using TBB also inside the
  53. application.
  54. Further, the join mode only works properly starting with TBB v4.4 Update
  55. 1.
  56. For earlier TBB versions, threads that call \f[C]rtcJoinCommitScene\f[]
  57. to join a running build will just trigger the build and wait for the
  58. build to finish.
  59. Further, old TBB versions with
  60. \f[C]TBB_INTERFACE_VERSION_MAJOR\ <\ 8\f[] do not support
  61. \f[C]rtcJoinCommitScene\f[], and invoking this function will result in
  62. an error.
  63. .PP
  64. When using Embree with the internal tasking system, only threads that
  65. call \f[C]rtcJoinCommitScene\f[] will perform the build operation, and
  66. no additional worker threads will be scheduled.
  67. .PP
  68. When using Embree with the Parallel Patterns Library (PPL),
  69. \f[C]rtcJoinCommitScene\f[] is not supported and calling that function
  70. will result in an error.
  71. .PP
  72. To detect whether \f[C]rtcJoinCommitScene\f[] is supported, use the
  73. \f[C]rtcGetDeviceProperty\f[] function.
  74. .SS EXIT STATUS
  75. .PP
  76. On failure an error code is set that can be queried using
  77. \f[C]rtcGetDeviceError\f[].
  78. .SS SEE ALSO
  79. .PP
  80. [rtcCommitScene], [rtcGetDeviceProperty]