.\" 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 "rtcSetNewGeometryBufferHostDevice" "3" "" "" "Embree Ray Tracing Kernels 4" .hy .SS NAME .IP .nf \f[C] rtcSetNewGeometryBufferHostDevice - creates and assigns a new host/device data buffer pair to the geometry \f[R] .fi .SS SYNOPSIS .IP .nf \f[C] #include void rtcSetNewGeometryBufferHostDevice( RTCGeometry geometry, enum RTCBufferType type, unsigned int slot, enum RTCFormat format, size_t byteStride, size_t itemCount, void** ptr, void** dptr ); \f[R] .fi .SS DESCRIPTION .PP The \f[V]rtcSetNewGeometryBufferHostDevice\f[R] function creates a new host/device data buffer pair of specified format (\f[V]format\f[R] argument), byte stride (\f[V]byteStride\f[R] argument), and number of items (\f[V]itemCount\f[R] argument), and assigns it to a geometry buffer slot (\f[V]type\f[R] and \f[V]slot\f[R] argument) of the specified geometry (\f[V]geometry\f[R] argument). The buffer data is managed internally and automatically freed when the geometry is destroyed. .PP The byte stride (\f[V]byteStride\f[R] argument) must be aligned to 4 bytes; otherwise the \f[V]rtcSetNewGeometryBufferHostDevice\f[R] function will fail. .PP The allocated buffer will be automatically over-allocated slightly when used as a vertex buffer, where a requirement is that each buffer element should be readable using 16-byte SSE load instructions. .PP If \f[V]ptr\f[R] is not null, it will be used to return the address of the host data buffer. If \f[V]dptr\f[R] is not null, it will be used to return the address of the device data buffer. Either \f[V]ptr\f[R] or \f[V]dptr\f[R] or both can be null. In this case \f[V]rtcGetGeometryBufferData\f[R] and \f[V]rtcGetGeometryBufferDataDevice\f[R] can be used to get the addresses of the host and device data buffers. .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 will return the same address as \f[V]ptr\f[R] if on null. In this case the function \f[V]rtcSetNewGeometryBufferHostDevice\f[R] will behave like \f[V]rtcSetSharedGeometryBuffer\f[R]. .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 [rtcSetNewGeometryBuffer], [rtcSetGeometryBuffer], [rtcSetSharedGeometryBuffer], [rtcGetGeometryBufferData], [rtcGetGeometryBufferDataDevice]