-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenderDrivers.cpp
131 lines (101 loc) · 3.87 KB
/
RenderDrivers.cpp
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
#include "RenderDrivers.h"
void registerGL1PlainDriver()
{
HRDriverInfo plain_gl1_info;
plain_gl1_info.supportHDRFrameBuffer = false;
plain_gl1_info.supportHDRTextures = false;
plain_gl1_info.supportMultiMaterialInstance = false;
plain_gl1_info.supportImageLoadFromInternalFormat = false;
plain_gl1_info.supportImageLoadFromExternalFormat = false;
plain_gl1_info.supportMeshLoadFromInternalFormat = false;
plain_gl1_info.supportLighting = false;
plain_gl1_info.memTotal = int64_t(8) * int64_t(1024 * 1024 * 1024);
plain_gl1_info.driverName = L"opengl1";
plain_gl1_info.createFunction = CreateOpenGL1_RenderDriver;
RenderDriverFactory::Register(L"opengl1", plain_gl1_info);
}
void registerGL1DelayedLoadDrivers()
{
HRDriverInfo driverInfo;
driverInfo.supportHDRFrameBuffer = false;
driverInfo.supportHDRTextures = false;
driverInfo.supportMultiMaterialInstance = false;
driverInfo.supportImageLoadFromInternalFormat = true;
driverInfo.supportImageLoadFromExternalFormat = true;
driverInfo.supportMeshLoadFromInternalFormat = false;
driverInfo.supportLighting = false;
driverInfo.memTotal = int64_t(8) * int64_t(1024 * 1024 * 1024);
driverInfo.driverName = L"opengl1DelayedLoad";
driverInfo.createFunction = CreateOpenGL1_DelayedLoad_RenderDriver;
RenderDriverFactory::Register(L"opengl1DelayedLoad", driverInfo);
HRDriverInfo driverInfo2;
driverInfo2.supportHDRFrameBuffer = false;
driverInfo2.supportHDRTextures = false;
driverInfo2.supportMultiMaterialInstance = false;
driverInfo2.supportImageLoadFromInternalFormat = true;
driverInfo2.supportImageLoadFromExternalFormat = true;
driverInfo2.supportMeshLoadFromInternalFormat = true;
driverInfo2.supportLighting = false;
driverInfo2.memTotal = int64_t(8) * int64_t(1024 * 1024 * 1024);
driverInfo2.driverName = L"opengl1DelayedLoad2";
driverInfo2.createFunction = CreateOpenGL1_DelayedLoad_RenderDriver2;
RenderDriverFactory::Register(L"opengl1DelayedLoad2", driverInfo2);
}
void registerGL1DrawBVHDriver()
{
HRDriverInfo driverInfo;
driverInfo.driverName = L"opengl1DrawBvh";
driverInfo.createFunction = CreateOpenGL1DrawBVH_RenderDriver;
RenderDriverFactory::Register(L"opengl1DrawBvh", driverInfo);
}
void registerGL1TestCustomAttributesDriver()
{
HRDriverInfo driverInfo;
driverInfo.driverName = L"opengl1TestCustomAttributes";
driverInfo.createFunction = CreateOpenGL1Debug_TestCustomAttributes;
RenderDriverFactory::Register(L"opengl1TestCustomAttributes", driverInfo);
}
void registerGL1TestSplitDriver()
{
HRDriverInfo driverInfo;
driverInfo.driverName = L"opengl1TestSplit";
driverInfo.createFunction = CreateOpenGL1TestSplit_RenderDriver;
RenderDriverFactory::Register(L"opengl1TestSplit", driverInfo);
}
void registerGL1DebugDriver()
{
HRDriverInfo driverInfo;
driverInfo.driverName = L"opengl1Debug";
driverInfo.createFunction = CreateOpenGL1Debug_RenderDriver;
RenderDriverFactory::Register(L"opengl1Debug", driverInfo);
}
void registerGL1DrawRaysDriver()
{
HRDriverInfo driverInfo;
driverInfo.driverName = L"opengl1DrawRays";
driverInfo.createFunction = CreateOpenGL1DrawRays_RenderDriver;
RenderDriverFactory::Register(L"opengl1DrawRays", driverInfo);
}
void registerAllGL1Drivers()
{
registerGL1PlainDriver();
registerGL1DelayedLoadDrivers();
registerGL1DrawBVHDriver();
registerGL1TestCustomAttributesDriver();
registerGL1TestSplitDriver();
registerGL1DebugDriver();
registerGL1DrawRaysDriver();
}
void printAllAvailableDrivers()
{
auto drivers = RenderDriverFactory::GetListOfRegisteredDrivers();
std::cout << "Render drivers currently registered in Hydra API: " << std::endl;
for(const auto &d :drivers)
{
if(!d.empty())
{
auto tmp = ws2s(d);
std::cout << tmp.c_str() << std::endl;
}
}
}