rtcSetSharedGeometryBuffer - assigns a view of a shared data buffer to a geometry
#include <embree3/rtcore.h> void rtcSetSharedGeometryBuffer( RTCGeometry geometry, enum RTCBufferType type, unsigned int slot, enum RTCFormat format, const void* ptr, size_t byteOffset, size_t byteStride, size_t itemCount );
rtcSetSharedGeometryBuffer function binds a view of a shared user-managed data buffer (
ptr argument) to a geometry buffer type and slot (
slot argument) of the specified geometry (
One can specify the start of the first buffer element in bytes (
byteOffset argument), the byte stride between individual buffer elements (
byteStride argument), the format of the buffer elements (
format argument), and the number of elements to bind (
The start address (
byteOffset argument) and stride (
byteStride argument) must be both aligned to 4 bytes; otherwise the
rtcSetGeometryBuffer function will fail.
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.
Sharing buffers can significantly reduce the memory required by the application, thus we recommend using this feature. When enabling the
RTC_SCENE_FLAG_COMPACT scene flag, the spatial index structures index into the vertex buffer, resulting in even higher memory savings.
On failure an error code is set that can be queried using