-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVisionarayDevice.h
127 lines (88 loc) · 3.76 KB
/
VisionarayDevice.h
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// Copyright 2022 The Khronos Group
// SPDX-License-Identifier: Apache-2.0
#pragma once
// helium
#include "helium/BaseDevice.h"
#include "VisionarayGlobalState.h"
#include "Object.h"
namespace visionaray {
struct VisionarayDevice : public helium::BaseDevice
{
/////////////////////////////////////////////////////////////////////////////
// Main interface to accepting API calls
/////////////////////////////////////////////////////////////////////////////
// Data Arrays //////////////////////////////////////////////////////////////
void *mapArray(ANARIArray) override;
void unmapArray(ANARIArray) override;
// API Objects //////////////////////////////////////////////////////////////
ANARIArray1D newArray1D(const void *appMemory,
ANARIMemoryDeleter deleter,
const void *userdata,
ANARIDataType,
uint64_t numItems1) override;
ANARIArray2D newArray2D(const void *appMemory,
ANARIMemoryDeleter deleter,
const void *userdata,
ANARIDataType,
uint64_t numItems1,
uint64_t numItems2) override;
ANARIArray3D newArray3D(const void *appMemory,
ANARIMemoryDeleter deleter,
const void *userdata,
ANARIDataType,
uint64_t numItems1,
uint64_t numItems2,
uint64_t numItems3) override;
// Renderable Objects ///////////////////////////////////////////////////////
ANARILight newLight(const char *type) override;
ANARICamera newCamera(const char *type) override;
ANARIGeometry newGeometry(const char *type) override;
ANARISpatialField newSpatialField(const char *type) override;
ANARISurface newSurface() override;
ANARIVolume newVolume(const char *type) override;
// Surface Meta-Data ////////////////////////////////////////////////////////
ANARIMaterial newMaterial(const char *material_type) override;
ANARISampler newSampler(const char *type) override;
// Instancing ///////////////////////////////////////////////////////////////
ANARIGroup newGroup() override;
ANARIInstance newInstance(const char *type) override;
// Top-level Worlds /////////////////////////////////////////////////////////
ANARIWorld newWorld() override;
// Query functions //////////////////////////////////////////////////////////
const char ** getObjectSubtypes(ANARIDataType objectType) override;
const void* getObjectInfo(ANARIDataType objectType,
const char* objectSubtype,
const char* infoName,
ANARIDataType infoType) override;
const void* getParameterInfo(ANARIDataType objectType,
const char* objectSubtype,
const char* parameterName,
ANARIDataType parameterType,
const char* infoName,
ANARIDataType infoType) override;
// Object + Parameter Lifetime Management ///////////////////////////////////
int getProperty(ANARIObject object,
const char *name,
ANARIDataType type,
void *mem,
uint64_t size,
uint32_t mask) override;
// FrameBuffer Manipulation /////////////////////////////////////////////////
ANARIFrame newFrame() override;
// Frame Rendering //////////////////////////////////////////////////////////
ANARIRenderer newRenderer(const char *type) override;
/////////////////////////////////////////////////////////////////////////////
// Helper/other functions and data members
/////////////////////////////////////////////////////////////////////////////
VisionarayDevice(ANARIStatusCallback defaultCallback, const void *userPtr);
VisionarayDevice(ANARILibrary);
~VisionarayDevice() override;
void initDevice();
void deviceCommitParameters() override;
int deviceGetProperty(
const char *name, ANARIDataType type, void *mem, uint64_t size) override;
private:
VisionarayGlobalState *deviceState() const;
bool m_initialized{false};
};
} // namespace visionaray