forked from KhronosGroup/ANARI-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelideGlobalState.h
60 lines (44 loc) · 1.63 KB
/
HelideGlobalState.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
// Copyright 2022-2024 The Khronos Group
// SPDX-License-Identifier: Apache-2.0
#pragma once
#include "RenderingSemaphore.h"
#include "HelideMath.h"
// helium
#include "helium/BaseGlobalDeviceState.h"
// embree
#include "embree4/rtcore.h"
namespace helide {
struct Frame;
struct HelideGlobalState : public helium::BaseGlobalDeviceState
{
int numThreads{1};
struct ObjectUpdates
{
helium::TimeStamp lastBLSReconstructSceneRequest{0};
helium::TimeStamp lastBLSCommitSceneRequest{0};
helium::TimeStamp lastTLSReconstructSceneRequest{0};
} objectUpdates;
RenderingSemaphore renderingSemaphore;
Frame *currentFrame{nullptr};
anari::Device anariDevice{nullptr}; // public handle of _this_ helide instance
RTCDevice embreeDevice{nullptr};
bool allowInvalidSurfaceMaterials{true};
float4 invalidMaterialColor{1.f, 0.f, 1.f, 1.f};
// Helper methods //
HelideGlobalState(ANARIDevice d);
void waitOnCurrentFrame() const;
};
// Helper functions/macros ////////////////////////////////////////////////////
inline HelideGlobalState *asHelideState(helium::BaseGlobalDeviceState *s)
{
return (HelideGlobalState *)s;
}
#define HELIDE_ANARI_TYPEFOR_SPECIALIZATION(type, anari_type) \
namespace anari { \
ANARI_TYPEFOR_SPECIALIZATION(type, anari_type); \
}
#define HELIDE_ANARI_TYPEFOR_DEFINITION(type) \
namespace anari { \
ANARI_TYPEFOR_DEFINITION(type); \
}
} // namespace helide