File: rtcore_buffer.isph

package info (click to toggle)
embree 4.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 99,492 kB
  • sloc: cpp: 224,036; xml: 40,944; ansic: 2,731; python: 812; sh: 639; makefile: 228; csh: 42
file content (65 lines) | stat: -rw-r--r-- 2,213 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#ifndef __RTC_BUFFER_ISPH__
#define __RTC_BUFFER_ISPH__

#include "rtcore_device.isph"

/* Types of buffers */
enum RTCBufferType
{
  RTC_BUFFER_TYPE_INDEX            = 0,
  RTC_BUFFER_TYPE_VERTEX           = 1,
  RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE = 2,
  RTC_BUFFER_TYPE_NORMAL           = 3,
  RTC_BUFFER_TYPE_TANGENT          = 4,
  RTC_BUFFER_TYPE_NORMAL_DERIVATIVE = 5,

  RTC_BUFFER_TYPE_GRID                 = 8,

  RTC_BUFFER_TYPE_FACE                 = 16,
  RTC_BUFFER_TYPE_LEVEL                = 17,
  RTC_BUFFER_TYPE_EDGE_CREASE_INDEX    = 18,
  RTC_BUFFER_TYPE_EDGE_CREASE_WEIGHT   = 19,
  RTC_BUFFER_TYPE_VERTEX_CREASE_INDEX  = 20,
  RTC_BUFFER_TYPE_VERTEX_CREASE_WEIGHT = 21,
  RTC_BUFFER_TYPE_HOLE                 = 22,

  RTC_BUFFER_TYPE_TRANSFORM            = 23,

  RTC_BUFFER_TYPE_FLAGS = 32
};

/* Opaque buffer type */
typedef uniform struct RTCBufferTy* uniform RTCBuffer;

/* Creates a new buffer. */
RTC_API RTCBuffer rtcNewBuffer(RTCDevice device, uniform uintptr_t byteSize);

/* Creates a new buffer using explicit host device memory. */
RTC_API RTCBuffer rtcNewBufferHostDevice(RTCDevice device, uniform size_t byteSize);

/* Creates a new shared buffer. */
RTC_API RTCBuffer rtcNewSharedBuffer(RTCDevice device, void* uniform ptr, uniform uintptr_t byteSize);

/* Creates a new shared buffer using explicit host device memory. */
RTC_API RTCBuffer rtcNewSharedBufferHostDevice(RTCDevice device, void* uniform ptr, uniform uintptr_t byteSize);

RTC_API void rtcCommitBuffer(RTCBuffer buffer);

/* Returns a pointer to the buffer data. */
RTC_API void* uniform rtcGetBufferData(RTCBuffer buffer);

/* Returns a pointer to the buffer data on the device. Returns the same pointer as
  rtcGetBufferData if the device is no SYCL device or if Embree is executed on a
  system with unified memory (e.g., iGPUs). */
RTC_API void* uniform rtcGetBufferDataDevice(RTCBuffer buffer);

/* Retains the buffer (increments the reference count). */
RTC_API void rtcRetainBuffer(RTCBuffer buffer);

/* Releases the buffer handle (decrements the reference count). */
RTC_API void rtcReleaseBuffer(RTCBuffer buffer);

#endif