.\" Automatically generated by Pandoc 3.1.3 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "rtcSetSharedGeometryBufferHostDevice" "3" "" "" "Embree Ray Tracing Kernels 4" .hy .SS NAME .IP .nf \f[C] rtcSetSharedGeometryBufferHostDevice - assigns views of shared data buffers to a geometry using explicit host and device memory \f[R] .fi .SS SYNOPSIS .IP .nf \f[C] #include void rtcSetSharedGeometryBuffer( RTCGeometry geometry, enum RTCBufferType type, unsigned int slot, enum RTCFormat format, const void* ptr, const void* dptr, size_t byteOffset, size_t byteStride, size_t itemCount ); \f[R] .fi .SS DESCRIPTION .PP The \f[V]rtcSetSharedGeometryBufferHostDevice\f[R] function binds views of a shared user-managed data buffers to a geometry buffer type and slot (\f[V]type\f[R] and \f[V]slot\f[R] argument) of the specified geometry (\f[V]geometry\f[R] argument). The user-managed data buffers are passed using the \f[V]ptr\f[R] argument for the host side allocated memory and the \f[V]dptr\f[R] parameter for the memory allocated on the device. .PP One can specify the start of the first buffer element in bytes (\f[V]byteOffset\f[R] argument), the byte stride between individual buffer elements (\f[V]byteStride\f[R] argument), the format of the buffer elements (\f[V]format\f[R] argument), and the number of elements to bind (\f[V]itemCount\f[R]). .PP The start address (\f[V]byteOffset\f[R] argument) and stride (\f[V]byteStride\f[R] argument) must be both aligned to 4 bytes; otherwise the \f[V]rtcSetSharedGeometryBufferHostDevice\f[R] function will fail. .IP .nf \f[C] \f[R] .fi .PP The buffer data must remain valid for as long as the buffer may be used, and the user is responsible for freeing the buffer data when no longer required. .PP The application is responsible of keeping the host and device memory in sync. The host memory has to be updated before calls of \f[V]rtcCommitScene\f[R] involving the associated geometry. .PP If Embree has no SYCL support or the associated Embree device is no SYCL device the \f[V]dptr\f[R] argument must be a null pointer. In this case the function \f[V]rtcSetSharedGeometryBufferHostDevice\f[R] will behave like \f[V]rtcSetSharedGeometryBuffer\f[R]. .PP Sharing buffers can significantly reduce the memory required by the application, thus we recommend using this feature. When enabling the \f[V]RTC_SCENE_FLAG_COMPACT\f[R] scene flag, the spatial index structures index into the vertex buffer, resulting in even higher memory savings. .SS EXIT STATUS .PP On failure an error code is set that can be queried using \f[V]rtcGetDeviceError\f[R]. .SS SEE ALSO .PP [rtcSetSharedGeometryBuffer], [rtcSetGeometryBuffer], [rtcSetNewGeometryBuffer]