RTCCOMMITSCENEWITHQUEUE(3)

πŸ“¦ version 4.4.1, in ubuntu stonking

πŸ’– rtcCommitSceneWithQueue β€” bestie edition πŸ’–

okay so this page is rtcCommitSceneWithQueue(3) from the Embree Ray Tracing Kernels 4 manual (yes that's the whole manual name, we're in section 3, we're fancy like that ✨). Sit down, hydrate, we're committing scene changes with a SYCL queue today and honestly? iconic 🫢


🌸 NAME 🌸

rtcCommitSceneWithQueue β€” commits scene changes using a given SYCL queue for host-to-device memory transfers πŸ’…


✨ SYNOPSIS ✨

#include <embree4/rtcore.h>

void rtcCommitScene(RTCScene scene,
  sycl::queue queue,
  sycl::event* event);

(yes bestie, that's literally how it's written, we don't touch code around here πŸ™ˆ)


πŸ’œ DESCRIPTION πŸ’œ

So. rtcCommitSceneWithQueue commits all the changes for the specified scene (that's the scene argument, the main character here πŸ‘‘). Internally it triggers building of a spatial acceleration structure for the scene, and it's gonna use all available worker threads for that β€” not me, not you, all of them πŸ”₯.

You can only do ray queries after you've committed all the scene changes. No shortcuts, no skipping, that's the vibe check and you passed or you didn't.

Now here's the tea πŸ“: rtcCommitSceneWithQueue differs from rtcCommitScene in exactly one way β€” and it's a big one. The ...WithQueue version uses a SYCL queue that you, the application, pass in, for asynchronous host-to-device memory transfers. Meanwhile plain old rtcCommitScene uses an internal and temporary SYCL queue, and it's blocking, meaning it doesn't return until all memory transfers are completed. So one of them hands you the baton and one of them just... does the whole relay itself. fr fr.

The application is responsible for synchronization when using rtcCommitSceneWithQueue. You've got two options, pick your fighter:

  • call wait() on the queue, or
  • use the optional event argument to receive a copy of the sycl::event associated with the last memcpy command that was submitted to the queue.

And note this: the event argument can also be a null pointer, in which case the argument will be ignored internally. Like, ghosted completely πŸ’€.

Also important, no cap: a SYCL kernel calling rtcTraversableIntersect or rtcTraversableOccluded using a RTCTraversable associated with the RTCScene scene has a dependency on the host-to-device memory transfers, and therefore has to be synchronized properly. Do not skip this. The dependency does not care about your feelings 😭.

real talk: this function is only available when SYCL support is enabled. And if the RTCDevice associated with the scene is not a SYCL device, then rtcCommitSceneWithQueue will behave the same as rtcCommitScene. Same behavior, different entrance ✨.

πŸŽ€ EXIT STATUS πŸŽ€

On failure, an error code is set that you can query using rtcGetDeviceError. That's your little status check-in, don't ignore it bestie πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹

  • [rtcCommitScene]

and that's the whole page, you ate it, no crumbs left 🌈⭐ this has been rtcCommitSceneWithQueue(3) from the Embree Ray Tracing Kernels 4 manual β€” mwah, take care of your queues out there πŸ§šπŸ’œ

πŸ“¦ where this page comes from