Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/thirdparty/embree/include/embree4/rtcore_buffer.h
9905 views
1
// Copyright 2009-2021 Intel Corporation
2
// SPDX-License-Identifier: Apache-2.0
3
4
#pragma once
5
6
#include "rtcore_device.h"
7
8
RTC_NAMESPACE_BEGIN
9
10
/* Types of buffers */
11
enum RTCBufferType
12
{
13
RTC_BUFFER_TYPE_INDEX = 0,
14
RTC_BUFFER_TYPE_VERTEX = 1,
15
RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE = 2,
16
RTC_BUFFER_TYPE_NORMAL = 3,
17
RTC_BUFFER_TYPE_TANGENT = 4,
18
RTC_BUFFER_TYPE_NORMAL_DERIVATIVE = 5,
19
20
RTC_BUFFER_TYPE_GRID = 8,
21
22
RTC_BUFFER_TYPE_FACE = 16,
23
RTC_BUFFER_TYPE_LEVEL = 17,
24
RTC_BUFFER_TYPE_EDGE_CREASE_INDEX = 18,
25
RTC_BUFFER_TYPE_EDGE_CREASE_WEIGHT = 19,
26
RTC_BUFFER_TYPE_VERTEX_CREASE_INDEX = 20,
27
RTC_BUFFER_TYPE_VERTEX_CREASE_WEIGHT = 21,
28
RTC_BUFFER_TYPE_HOLE = 22,
29
30
RTC_BUFFER_TYPE_TRANSFORM = 23,
31
32
RTC_BUFFER_TYPE_FLAGS = 32
33
};
34
35
/* Opaque buffer type */
36
typedef struct RTCBufferTy* RTCBuffer;
37
38
/* Creates a new buffer. */
39
RTC_API RTCBuffer rtcNewBuffer(RTCDevice device, size_t byteSize);
40
41
/* Creates a new buffer using explicit host device memory. */
42
RTC_API RTCBuffer rtcNewBufferHostDevice(RTCDevice device, size_t byteSize);
43
44
/* Creates a new shared buffer. */
45
RTC_API RTCBuffer rtcNewSharedBuffer(RTCDevice device, void* ptr, size_t byteSize);
46
47
/* Creates a new shared buffer using explicit host device memory. */
48
RTC_API RTCBuffer rtcNewSharedBufferHostDevice(RTCDevice device, void* ptr, size_t byteSize);
49
50
/* Synchronize host and device memory by copying data from host to device. */
51
RTC_API void rtcCommitBuffer(RTCBuffer buffer);
52
53
#if defined(EMBREE_SYCL_SUPPORT) && defined(SYCL_LANGUAGE_VERSION)
54
55
RTC_API_CPP sycl::event rtcCommitBufferWithQueue(RTCBuffer buffer, sycl::queue queue);
56
57
#endif
58
59
/* Returns a pointer to the buffer data. */
60
RTC_API void* rtcGetBufferData(RTCBuffer buffer);
61
62
/* Returns a pointer to the buffer data on the device. Returns the same pointer as
63
rtcGetBufferData if the device is no SYCL device or if Embree is executed on a
64
system with unified memory (e.g., iGPUs). */
65
RTC_API void* rtcGetBufferDataDevice(RTCBuffer buffer);
66
67
/* Retains the buffer (increments the reference count). */
68
RTC_API void rtcRetainBuffer(RTCBuffer buffer);
69
70
/* Releases the buffer (decrements the reference count). */
71
RTC_API void rtcReleaseBuffer(RTCBuffer buffer);
72
73
RTC_NAMESPACE_END
74
75