.\" Automatically generated by Pandoc 2.5
.\"
.TH "rtcNewSharedBuffer" "3" "" "" "Embree Ray Tracing Kernels 3"
.hy
.SS NAME
.IP
.nf
\f[C]
rtcNewSharedBuffer \- creates a new shared data buffer
\f[R]
.fi
.SS SYNOPSIS
.IP
.nf
\f[C]
#include <embree3/rtcore.h>

RTCBuffer rtcNewSharedBuffer(
  RTCDevice device,
  void* ptr,
  size_t byteSize
);
\f[R]
.fi
.SS DESCRIPTION
.PP
The \f[C]rtcNewSharedBuffer\f[R] function creates a new shared data
buffer object bound to the specified device (\f[C]device\f[R] argument).
The buffer object is reference counted with an initial reference count
of 1.
The buffer can be released using the \f[C]rtcReleaseBuffer\f[R]
function.
.PP
At construction time, the pointer to the user\-managed buffer data
(\f[C]ptr\f[R] argument) including its size in bytes (\f[C]byteSize\f[R]
argument) is provided to create the buffer.
At buffer construction time no buffer data is allocated, but the buffer
data provided by the application is used.
The buffer data must remain valid for as long as the buffer may be used,
and the user is responsible to free the buffer data when no longer
required.
.IP
.nf
\f[C]
\f[R]
.fi
.PP
The data pointer (\f[C]ptr\f[R] argument) must be aligned to 4 bytes;
otherwise the \f[C]rtcNewSharedBuffer\f[R] function will fail.
.SS EXIT STATUS
.PP
On failure \f[C]NULL\f[R] is returned and an error code is set that can
be queried using \f[C]rtcGetDeviceError\f[R].
.SS SEE ALSO
.PP
[rtcRetainBuffer], [rtcReleaseBuffer]
