-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVisionarayGlobalState.h
62 lines (48 loc) · 1.59 KB
/
VisionarayGlobalState.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
#pragma once
// helium
#include "helium/BaseGlobalDeviceState.h"
// visionaray
#include "visionaray/detail/thread_pool.h"
// ours
#include "DeviceObjectRegistry.h"
#include "RenderingSemaphore.h"
namespace visionaray {
struct Frame;
struct VisionarayGlobalState : public helium::BaseGlobalDeviceState
{
thread_pool threadPool;
struct ObjectUpdates
{
helium::TimeStamp lastBLSReconstructSceneRequest{0};
helium::TimeStamp lastBLSCommitSceneRequest{0};
helium::TimeStamp lastTLSReconstructSceneRequest{0};
} objectUpdates;
DeviceCopyableObjects dcos;
DeviceObjectRegistry onDevice;
#ifdef WITH_CUDA
cudaStream_t stream;
#elif defined(WITH_HIP)
hipStream_t stream;
#else
RenderingSemaphore renderingSemaphore;
#endif
Frame *currentFrame{nullptr};
// Helper methods //
VisionarayGlobalState(ANARIDevice d);
~VisionarayGlobalState();
void waitOnCurrentFrame() const;
};
// Helper functions/macros ////////////////////////////////////////////////////
inline VisionarayGlobalState *asVisionarayState(helium::BaseGlobalDeviceState *s)
{
return (VisionarayGlobalState *)s;
}
#define VISIONARAY_ANARI_TYPEFOR_SPECIALIZATION(type, anari_type) \
namespace anari { \
ANARI_TYPEFOR_SPECIALIZATION(type, anari_type); \
}
#define VISIONARAY_ANARI_TYPEFOR_DEFINITION(type) \
namespace anari { \
ANARI_TYPEFOR_DEFINITION(type); \
}
} // visionaray