rtcJoinCommitScene(3)

๐Ÿ“ฆ version 3.13.5, in epel 9, fedora 43, fedora 44

๐Ÿ’– rtcJoinCommitScene โ€” like, the group-chat commit ๐Ÿ’–

okay bestie, welcome to rtcJoinCommitScene(3) from the Embree Ray Tracing Kernels 3 lineup. this one is the commits the scene from multiple threads girlie, and she is lowkey iconic for it. let's get into it ๐Ÿซถ


โœจ SYNOPSIS โœจ

#include <embree3/rtcore.h>

void rtcJoinCommitScene(RTCScene scene);

๐ŸŒธ DESCRIPTION ๐ŸŒธ

so rtcJoinCommitScene commits all your changes for the specified scene (that's the scene argument, bestie ๐Ÿ’…). and like, committing a scene internally triggers building of a spatial acceleration structure for that scene. once your scene changes got properly committed, then you can do ray queries. no commit, no queries, periodt.

here's the main character part: rtcJoinCommitScene can get called from multiple user threads, and they will all cooperate in the build operation. every thread that calls into this function will return from rtcJoinCommitScene after the scene commit is finished. and this is not a vibe-you-can-mix situation โ€” all threads must consistently call rtcJoinCommitScene and not rtcCommitScene. don't be switching up on us ๐Ÿ™ˆ

so how is she different from rtcCommitScene? rtcJoinCommitScene can be called from multiple user threads, whereas rtcCommitScene can only get called from multiple TBB worker threads when used concurrently. and ngl, for optimal performance we strongly recommend using TBB inside the application together with the rtcCommitScene function, and to avoid using the rtcJoinCommitScene function. yes, she's telling you to not use her for max speed. self-aware queen ๐Ÿ‘‘

but wait, she still ate for flexibility: rtcJoinCommitScene allows a flexible way to lazily create hierarchies during rendering. picture this โ€” a thread reaching a not-yet-constructed sub-scene of a two-level scene can generate the sub-scene geometry and call rtcJoinCommitScene on that just generated scene. then during construction, further threads reaching the not-yet-built scene can join the build operation by also invoking rtcJoinCommitScene. and a thread that calls rtcJoinCommitScene after the build finishes will just directly return from the rtcJoinCommitScene call. like, "oh y'all already done? cool, bye ๐Ÿ’–"

also multiple scene commit operations on different scenes can be running at the same time. so yes, it is possible to commit many small scenes in parallel, distributing the commits to many threads. parallelism slay ๐Ÿ”ฅ

๐Ÿงš the backend tea ๐Ÿงš

depending on what Embree is running with, the behaviour changes, so pay attention bestie:

  • Intelยฎ Threading Building Blocks (the default) โ€” threads that call rtcJoinCommitScene will join the build operation, but other TBB worker threads might also participate in the build. to avoid thread oversubscription, we recommend using TBB also inside the application. further, the join mode only works properly starting with TBB v4.4 Update 1. for earlier TBB versions, threads that call rtcJoinCommitScene to join a running build will just trigger the build and wait for the build to finish. further, old TBB versions with TBB_INTERFACE_VERSION_MAJOR < 8 do not support rtcJoinCommitScene, and invoking this function will result in an error. ๐Ÿ’€
  • the internal tasking system โ€” only threads that call rtcJoinCommitScene will perform the build operation, and no additional worker threads will be scheduled.
  • the Parallel Patterns Library (PPL) โ€” rtcJoinCommitScene is not supported and calling that function will result in an error. ๐Ÿ˜ญ

to detect whether rtcJoinCommitScene is supported, use the rtcGetDeviceProperty function. vibe check your device first, fr fr.


๐Ÿ’€ EXIT STATUS ๐Ÿ’€

on failure an error code is set that can be queried using rtcGetDeviceError.


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

  • [rtcCommitScene]
  • [rtcGetDeviceProperty]

and that's the whole page, bestie ๐ŸŽ€ rtcJoinCommitScene(3) straight out of the Embree Ray Tracing Kernels 3 manual โ€” go forth, commit responsibly, and remember: all threads together or not at all ๐Ÿฆ‹๐Ÿ’œโœจ

๐Ÿ“ฆ where this page comes from