rtcNewSharedBuffer.3embree3 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. .TH "rtcNewSharedBuffer" "3" "" "" "Embree Ray Tracing Kernels 3"
  2. .SS NAME
  3. .IP
  4. .nf
  5. \f[C]
  6. rtcNewSharedBuffer\ \-\ creates\ a\ new\ shared\ data\ buffer
  7. \f[]
  8. .fi
  9. .SS SYNOPSIS
  10. .IP
  11. .nf
  12. \f[C]
  13. #include\ <embree3/rtcore.h>
  14. RTCBuffer\ rtcNewSharedBuffer(
  15. \ \ RTCDevice\ device,
  16. \ \ void*\ ptr,
  17. \ \ size_t\ byteSize
  18. );
  19. \f[]
  20. .fi
  21. .SS DESCRIPTION
  22. .PP
  23. The \f[C]rtcNewSharedBuffer\f[] function creates a new shared data
  24. buffer object bound to the specified device (\f[C]device\f[] argument).
  25. The buffer object is reference counted with an initial reference count
  26. of 1.
  27. The buffer can be released using the \f[C]rtcReleaseBuffer\f[] function.
  28. .PP
  29. At construction time, the pointer to the user\-managed buffer data
  30. (\f[C]ptr\f[] argument) including its size in bytes (\f[C]byteSize\f[]
  31. argument) is provided to create the buffer.
  32. At buffer construction time no buffer data is allocated, but the buffer
  33. data provided be the application is used.
  34. The buffer data must remain valid for as long as the buffer may be used,
  35. and the user is responsible to free the buffer data when no longer
  36. required.
  37. .IP
  38. .nf
  39. \f[C]
  40. \f[]
  41. .fi
  42. .PP
  43. The data pointer (\f[C]ptr\f[] argument) must be aligned to 4 bytes;
  44. otherwise the \f[C]rtcNewSharedBuffer\f[] function will fail.
  45. .SS EXIT STATUS
  46. .PP
  47. On failure \f[C]NULL\f[] is returned and an error code is set that can
  48. be queried using \f[C]rtcGetDeviceError\f[].
  49. .SS SEE ALSO
  50. .PP
  51. [rtcRetainBuffer], [rtcReleaseBuffer]