forked from KhronosGroup/ANARI-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelideDevice.h
102 lines (82 loc) · 3.24 KB
/
HelideDevice.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
// Copyright 2022-2024 The Khronos Group
// SPDX-License-Identifier: Apache-2.0
#pragma once
// helium
#include "helium/BaseDevice.h"
#include "HelideGlobalState.h"
#include "Object.h"
namespace helide {
struct HelideDevice : 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;
ANARICamera newCamera(const char *type) override;
ANARIFrame newFrame() override;
ANARIGeometry newGeometry(const char *type) override;
ANARIGroup newGroup() override;
ANARIInstance newInstance(const char *type) override;
ANARILight newLight(const char *type) override;
ANARIMaterial newMaterial(const char *material_type) override;
ANARIRenderer newRenderer(const char *type) override;
ANARISampler newSampler(const char *type) override;
ANARISpatialField newSpatialField(const char *type) override;
ANARISurface newSurface() override;
ANARIVolume newVolume(const char *type) override;
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;
/////////////////////////////////////////////////////////////////////////////
// Helper/other functions and data members
/////////////////////////////////////////////////////////////////////////////
HelideDevice(ANARIStatusCallback defaultCallback, const void *userPtr);
HelideDevice(ANARILibrary);
~HelideDevice() override;
void initDevice();
void deviceCommitParameters() override;
int deviceGetProperty(
const char *name, ANARIDataType type, void *mem, uint64_t size) override;
private:
HelideGlobalState *deviceState() const;
bool m_initialized{false};
};
} // namespace helide