rtcore_buffer.isph 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // ======================================================================== //
  2. // Copyright 2009-2018 Intel Corporation //
  3. // //
  4. // Licensed under the Apache License, Version 2.0 (the "License"); //
  5. // you may not use this file except in compliance with the License. //
  6. // You may obtain a copy of the License at //
  7. // //
  8. // http://www.apache.org/licenses/LICENSE-2.0 //
  9. // //
  10. // Unless required by applicable law or agreed to in writing, software //
  11. // distributed under the License is distributed on an "AS IS" BASIS, //
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
  13. // See the License for the specific language governing permissions and //
  14. // limitations under the License. //
  15. // ======================================================================== //
  16. #ifndef __RTC_BUFFER_ISPH__
  17. #define __RTC_BUFFER_ISPH__
  18. #include "rtcore_device.isph"
  19. /* Types of buffers */
  20. enum RTCBufferType
  21. {
  22. RTC_BUFFER_TYPE_INDEX = 0,
  23. RTC_BUFFER_TYPE_VERTEX = 1,
  24. RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE = 2,
  25. RTC_BUFFER_TYPE_NORMAL = 3,
  26. RTC_BUFFER_TYPE_TANGENT = 4,
  27. RTC_BUFFER_TYPE_NORMAL_DERIVATIVE = 5,
  28. RTC_BUFFER_TYPE_GRID = 8,
  29. RTC_BUFFER_TYPE_FACE = 16,
  30. RTC_BUFFER_TYPE_LEVEL = 17,
  31. RTC_BUFFER_TYPE_EDGE_CREASE_INDEX = 18,
  32. RTC_BUFFER_TYPE_EDGE_CREASE_WEIGHT = 19,
  33. RTC_BUFFER_TYPE_VERTEX_CREASE_INDEX = 20,
  34. RTC_BUFFER_TYPE_VERTEX_CREASE_WEIGHT = 21,
  35. RTC_BUFFER_TYPE_HOLE = 22,
  36. RTC_BUFFER_TYPE_FLAGS = 32
  37. };
  38. /* Opaque buffer type */
  39. typedef uniform struct RTCBufferTy* uniform RTCBuffer;
  40. /* Creates a new buffer. */
  41. RTC_API RTCBuffer rtcNewBuffer(RTCDevice device, uniform uintptr_t byteSize);
  42. /* Creates a new shared buffer. */
  43. RTC_API RTCBuffer rtcNewSharedBuffer(RTCDevice device, void* uniform ptr, uniform uintptr_t byteSize);
  44. /* Returns a pointer to the buffer data. */
  45. RTC_API void* uniform rtcGetBufferData(RTCBuffer buffer);
  46. /* Retains the buffer (increments the reference count). */
  47. RTC_API void rtcRetainBuffer(RTCBuffer buffer);
  48. /* Releases the buffer handle (decrements the reference count). */
  49. RTC_API void rtcReleaseBuffer(RTCBuffer buffer);
  50. #endif