.\" 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 "rtcNewBuffer" "3" "" "" "Embree Ray Tracing Kernels 4" .hy .SS NAME .IP .nf \f[C] rtcNewBuffer - creates a new data buffer \f[R] .fi .SS SYNOPSIS .IP .nf \f[C] #include RTCBuffer rtcNewBuffer( RTCDevice device, size_t byteSize ); \f[R] .fi .SS DESCRIPTION .PP The \f[V]rtcNewBuffer\f[R] function creates a new data buffer object of specified size in bytes (\f[V]byteSize\f[R] argument) that is bound to the specified device (\f[V]device\f[R] argument). The buffer object is reference counted with an initial reference count of 1. The returned buffer object can be released using the \f[V]rtcReleaseBuffer\f[R] API call. The specified number of bytes are allocated at buffer construction time and deallocated when the buffer is destroyed. .IP .nf \f[C] \f[R] .fi .PP If the \f[V]device\f[R] is a Embree SYCL device, the buffer will be allocated using SYCL USM shared memory, i.e.\ the buffer can be accessed on the host and device (GPU) and the SYCL runtime will handle buffer transfers automatically. .PP For precise control over when memory is copied from host to device, a buffer can also be created using \f[V]rtcNewBufferHostDevice\f[R]. .SS EXIT STATUS .PP On failure \f[V]NULL\f[R] is returned and an error code is set that can be queried using \f[V]rtcGetDeviceError\f[R]. .SS SEE ALSO .PP [rtcNewBufferHostDevice], [rtcRetainBuffer], [rtcReleaseBuffer]