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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 857c848b9..0423b3e3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -448,6 +448,17 @@ elseif(UNIX)
endif()
endif()
+# glslang package does not export a -config.cmake file.
+option(GLSLANG_TARGET_DIR "Absolute path to glslangTargets.cmake directory")
+include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake")
+include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake")
+include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake")
+include("${GLSLANG_TARGET_DIR}/glslangTargets.cmake")
+include("${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake")
+if(NOT TARGET glslang OR NOT TARGET SPIRV)
+ message(FATAL_ERROR "glslang or SPIRV target not found")
+endif()
+
add_subdirectory(renderdoc)
# these variables are handled within the CMakeLists.txt in qrenderdoc,
diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt
index a26438d76..9ee043959 100644
--- a/renderdoc/CMakeLists.txt
+++ b/renderdoc/CMakeLists.txt
@@ -601,7 +601,7 @@ endif()
add_library(renderdoc SHARED ${renderdoc_objects})
target_compile_definitions(renderdoc ${RDOC_DEFINITIONS})
target_include_directories(renderdoc ${RDOC_INCLUDES})
-target_link_libraries(renderdoc ${RDOC_LIBRARIES})
+target_link_libraries(renderdoc ${RDOC_LIBRARIES} glslang SPIRV)
add_dependencies(renderdoc renderdoc_libentry)
diff --git a/renderdoc/data/glsl_shaders.cpp b/renderdoc/data/glsl_shaders.cpp
index dd79c1f89..5295fb05e 100644
--- a/renderdoc/data/glsl_shaders.cpp
+++ b/renderdoc/data/glsl_shaders.cpp
@@ -26,7 +26,7 @@
#include "common/common.h"
#include "common/formatting.h"
#include "driver/shaders/spirv/glslang_compile.h"
-#include "glslang/glslang/Public/ShaderLang.h"
+#include <glslang/Public/ShaderLang.h>
#include "os/os_specific.h"
#define GLSL_HEADERS(HEADER) \
diff --git a/renderdoc/driver/gl/gl_shader_refl.cpp b/renderdoc/driver/gl/gl_shader_refl.cpp
index dfd871f32..57b5aeca6 100644
--- a/renderdoc/driver/gl/gl_shader_refl.cpp
+++ b/renderdoc/driver/gl/gl_shader_refl.cpp
@@ -26,7 +26,7 @@
#include <algorithm>
#include <functional>
#include "driver/shaders/spirv/glslang_compile.h"
-#include "glslang/glslang/Public/ShaderLang.h"
+#include <glslang/Public/ShaderLang.h>
#include "gl_driver.h"
template <>
diff --git a/renderdoc/driver/shaders/spirv/CMakeLists.txt b/renderdoc/driver/shaders/spirv/CMakeLists.txt
index e5f2f4113..79525b5f6 100644
--- a/renderdoc/driver/shaders/spirv/CMakeLists.txt
+++ b/renderdoc/driver/shaders/spirv/CMakeLists.txt
@@ -1,91 +1,3 @@
-set(glslang_dir ${RDOC_SOURCE_DIR}/3rdparty/glslang)
-set(glslang_sources
- ${glslang_dir}/OGLCompilersDLL/InitializeDll.cpp
- ${glslang_dir}/OGLCompilersDLL/InitializeDll.h
- ${glslang_dir}/SPIRV/GlslangToSpv.cpp
- ${glslang_dir}/SPIRV/GlslangToSpv.h
- ${glslang_dir}/SPIRV/GLSL.std.450.h
- ${glslang_dir}/SPIRV/GLSL.ext.AMD.h
- ${glslang_dir}/SPIRV/GLSL.ext.EXT.h
- ${glslang_dir}/SPIRV/GLSL.ext.KHR.h
- ${glslang_dir}/SPIRV/GLSL.ext.NV.h
- ${glslang_dir}/SPIRV/hex_float.h
- ${glslang_dir}/SPIRV/InReadableOrder.cpp
- ${glslang_dir}/SPIRV/Logger.cpp
- ${glslang_dir}/SPIRV/Logger.h
- ${glslang_dir}/SPIRV/SpvBuilder.cpp
- ${glslang_dir}/SPIRV/SpvBuilder.h
- ${glslang_dir}/SPIRV/SpvTools.cpp
- ${glslang_dir}/SPIRV/SpvTools.h
- ${glslang_dir}/SPIRV/SpvPostProcess.cpp
- ${glslang_dir}/SPIRV/spvIR.h
- ${glslang_dir}/glslang/GenericCodeGen/CodeGen.cpp
- ${glslang_dir}/glslang/GenericCodeGen/Link.cpp
- ${glslang_dir}/glslang/Include/arrays.h
- ${glslang_dir}/glslang/Include/BaseTypes.h
- ${glslang_dir}/glslang/Include/Common.h
- ${glslang_dir}/glslang/Include/ConstantUnion.h
- ${glslang_dir}/glslang/Include/InfoSink.h
- ${glslang_dir}/glslang/Include/InitializeGlobals.h
- ${glslang_dir}/glslang/Include/intermediate.h
- ${glslang_dir}/glslang/Include/PoolAlloc.h
- ${glslang_dir}/glslang/Include/ResourceLimits.h
- ${glslang_dir}/glslang/Include/revision.h
- ${glslang_dir}/glslang/Include/ShHandle.h
- ${glslang_dir}/glslang/Include/Types.h
- ${glslang_dir}/glslang/MachineIndependent/Constant.cpp
- ${glslang_dir}/glslang/MachineIndependent/glslang_tab.cpp
- ${glslang_dir}/glslang/MachineIndependent/glslang_tab.cpp.h
- ${glslang_dir}/glslang/MachineIndependent/gl_types.h
- ${glslang_dir}/glslang/MachineIndependent/iomapper.cpp
- ${glslang_dir}/glslang/MachineIndependent/iomapper.h
- ${glslang_dir}/glslang/MachineIndependent/gl_types.h
- ${glslang_dir}/glslang/MachineIndependent/InfoSink.cpp
- ${glslang_dir}/glslang/MachineIndependent/Initialize.cpp
- ${glslang_dir}/glslang/MachineIndependent/Initialize.h
- ${glslang_dir}/glslang/MachineIndependent/Intermediate.cpp
- ${glslang_dir}/glslang/MachineIndependent/intermOut.cpp
- ${glslang_dir}/glslang/MachineIndependent/IntermTraverse.cpp
- ${glslang_dir}/glslang/MachineIndependent/limits.cpp
- ${glslang_dir}/glslang/MachineIndependent/linkValidate.cpp
- ${glslang_dir}/glslang/MachineIndependent/LiveTraverser.h
- ${glslang_dir}/glslang/MachineIndependent/localintermediate.h
- ${glslang_dir}/glslang/MachineIndependent/parseConst.cpp
- ${glslang_dir}/glslang/MachineIndependent/ParseContextBase.cpp
- ${glslang_dir}/glslang/MachineIndependent/ParseHelper.cpp
- ${glslang_dir}/glslang/MachineIndependent/ParseHelper.h
- ${glslang_dir}/glslang/MachineIndependent/PoolAlloc.cpp
- ${glslang_dir}/glslang/MachineIndependent/propagateNoContraction.cpp
- ${glslang_dir}/glslang/MachineIndependent/propagateNoContraction.h
- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpAtom.cpp
- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpContext.cpp
- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpContext.h
- ${glslang_dir}/glslang/MachineIndependent/preprocessor/Pp.cpp
- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpScanner.cpp
- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpTokens.cpp
- ${glslang_dir}/glslang/MachineIndependent/preprocessor/PpTokens.h
- ${glslang_dir}/glslang/MachineIndependent/reflection.cpp
- ${glslang_dir}/glslang/MachineIndependent/reflection.h
- ${glslang_dir}/glslang/MachineIndependent/RemoveTree.cpp
- ${glslang_dir}/glslang/MachineIndependent/RemoveTree.h
- ${glslang_dir}/glslang/MachineIndependent/ScanContext.h
- ${glslang_dir}/glslang/MachineIndependent/Scan.cpp
- ${glslang_dir}/glslang/MachineIndependent/Scan.h
- ${glslang_dir}/glslang/MachineIndependent/ShaderLang.cpp
- ${glslang_dir}/glslang/MachineIndependent/SymbolTable.cpp
- ${glslang_dir}/glslang/MachineIndependent/SymbolTable.h
- ${glslang_dir}/glslang/MachineIndependent/Versions.cpp
- ${glslang_dir}/glslang/MachineIndependent/Versions.h
- ${glslang_dir}/glslang/MachineIndependent/attribute.cpp
- ${glslang_dir}/glslang/MachineIndependent/attribute.h
- ${glslang_dir}/glslang/OSDependent/osinclude.h
- ${glslang_dir}/glslang/Public/ShaderLang.h)
-
-if(UNIX)
- list(APPEND glslang_sources
- ${glslang_dir}/glslang/OSDependent/Unix/ossource.cpp)
-endif()
-
set(sources
glslang_compile.cpp
glslang_compile.h
@@ -108,8 +20,7 @@ set(sources
spirv_processor.h
spirv_disassemble.cpp
spirv_stringise.cpp
- var_dispatch_helpers.h
- ${glslang_sources})
+ var_dispatch_helpers.h)
add_definitions(-DAMD_EXTENSIONS)
add_definitions(-DNV_EXTENSIONS)
diff --git a/renderdoc/driver/shaders/spirv/glslang_compile.cpp b/renderdoc/driver/shaders/spirv/glslang_compile.cpp
index e2f1f2df8..fc0adab99 100644
--- a/renderdoc/driver/shaders/spirv/glslang_compile.cpp
+++ b/renderdoc/driver/shaders/spirv/glslang_compile.cpp
@@ -29,8 +29,8 @@
#undef min
#undef max
-#include "glslang/glslang/Include/Types.h"
-#include "glslang/glslang/Public/ShaderLang.h"
+#include <glslang/Include/Types.h>
+#include <glslang/Public/ShaderLang.h>
static bool glslang_inited = false;
rdcarray<glslang::TShader *> *allocatedShaders = NULL;
@@ -129,7 +129,16 @@ static TBuiltInResource DefaultResources = {
/*.maxTaskWorkGroupSizeY_NV =*/1,
/*.maxTaskWorkGroupSizeZ_NV =*/1,
/*.maxMeshViewCountNV =*/4,
-
+ /*.maxMeshOutputVerticesEXT = */ 256,
+ /*.maxMeshOutputPrimitivesEXT = */ 256,
+ /*.maxMeshWorkGroupSizeX_EXT = */ 128,
+ /*.maxMeshWorkGroupSizeY_EXT = */ 128,
+ /*.maxMeshWorkGroupSizeZ_EXT = */ 128,
+ /*.maxTaskWorkGroupSizeX_EXT = */ 128,
+ /*.maxTaskWorkGroupSizeY_EXT = */ 128,
+ /*.maxTaskWorkGroupSizeZ_EXT = */ 128,
+ /*.maxMeshViewCountEXT = */ 4,
+ /*.maxDualSourceDrawBuffersEXT =*/1,
/*.limits*/
{
/*.limits.nonInductiveForLoops =*/1,
diff --git a/renderdoc/driver/shaders/spirv/spirv_compile.cpp b/renderdoc/driver/shaders/spirv/spirv_compile.cpp
index 8fbf2f16a..49bd322f4 100644
--- a/renderdoc/driver/shaders/spirv/spirv_compile.cpp
+++ b/renderdoc/driver/shaders/spirv/spirv_compile.cpp
@@ -31,8 +31,8 @@
#undef min
#undef max
-#include "glslang/SPIRV/GlslangToSpv.h"
-#include "glslang/glslang/Public/ShaderLang.h"
+#include <glslang/SPIRV/GlslangToSpv.h>
+#include <glslang/Public/ShaderLang.h>
rdcstr rdcspv::Compile(const rdcspv::CompilationSettings &settings, const rdcarray<rdcstr> &sources,
rdcarray<uint32_t> &spirv)
|