-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
213 lines (204 loc) · 7.86 KB
/
CMakeLists.txt
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
cmake_minimum_required (VERSION 3.30)
project(vk-gltf-viewer LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_MODULE_STD 1)
# --------------------
# External dependencies.
# --------------------
find_package(boost_container CONFIG REQUIRED)
find_package(CGAL CONFIG REQUIRED)
find_package(fastgltf CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(imgui CONFIG REQUIRED)
find_package(imguizmo CONFIG REQUIRED)
find_package(Ktx CONFIG REQUIRED)
find_package(mikktspace CONFIG REQUIRED)
find_package(nfd CONFIG REQUIRED)
find_package(OpenEXR CONFIG REQUIRED)
find_package(Stb REQUIRED)
find_package(vku CONFIG REQUIRED)
# --------------------
# Project targets.
# --------------------
add_executable(vk-gltf-viewer
impl.cpp
impl/control/AppWindow.cpp
impl/control/ImGuiTaskCollector.cpp
impl/AppState.cpp
impl/gltf/AssetGpuBuffers.cpp
impl/gltf/AssetSceneGpuBuffers.cpp
impl/MainApp.cpp
impl/mod.cpp
impl/vulkan/buffer/IndirectDrawCommands.cpp
impl/vulkan/Frame.cpp
impl/vulkan/Gpu.cpp
impl/vulkan/pipeline/BrdfmapComputer.cpp
impl/vulkan/pipeline/JumpFloodComputer.cpp
main.cpp
)
target_include_directories(vk-gltf-viewer PRIVATE
${Stb_INCLUDE_DIR}
)
target_sources(vk-gltf-viewer PRIVATE
FILE_SET CXX_MODULES
FILES
extlibs/thread_pool.cppm
extlibs/module-ports/fastgltf.cppm
extlibs/module-ports/glm.cppm
extlibs/module-ports/imgui/imgui.cppm
extlibs/module-ports/imgui/imgui.math.cppm
extlibs/module-ports/imgui/imgui.glfw.cppm
extlibs/module-ports/imgui/imgui.internal.cppm
extlibs/module-ports/imgui/imgui.vulkan.cppm
extlibs/module-ports/ImGuizmo.cppm
interface/mod.cppm
interface/AppState.cppm
interface/control/AppWindow.cppm
interface/control/Camera.cppm
interface/control/ImGuiTaskCollector.cppm
interface/control/Task.cppm
interface/gltf/algorithm/bounding_box.cppm
interface/gltf/algorithm/MikktSpaceInterface.cppm
interface/gltf/algorithm/miniball.cppm
interface/gltf/algorithm/traversal.cppm
interface/gltf/AssetExternalBuffers.cppm
interface/gltf/AssetGpuBuffers.cppm
interface/gltf/AssetGpuFallbackTexture.cppm
interface/gltf/AssetGpuTextures.cppm
interface/gltf/AssetPrimitiveInfo.cppm
interface/gltf/AssetSceneGpuBuffers.cppm
interface/gltf/AssetSceneHierarchy.cppm
interface/helpers/concepts.cppm
interface/helpers/cstring_view.cppm
interface/helpers/fastgltf.cppm
interface/helpers/full_optional.cppm
interface/helpers/functional.cppm
interface/helpers/imgui/mod.cppm
interface/helpers/imgui/table.cppm
interface/helpers/optional.cppm
interface/helpers/ranges/mod.cppm
interface/helpers/ranges/concat.cppm
interface/helpers/ranges/contains.cppm
interface/helpers/TempStringBuffer.cppm
interface/helpers/tristate.cppm
interface/helpers/type_variant.cppm
interface/MainApp.cppm
interface/math/extended_arithmetic.cppm
interface/math/Frustum.cppm
interface/math/Plane.cppm
interface/vulkan/attachment_group/DepthPrepass.cppm
interface/vulkan/attachment_group/JumpFloodSeed.cppm
interface/vulkan/attachment_group/SceneOpaque.cppm
interface/vulkan/attachment_group/SceneWeightedBlended.cppm
interface/vulkan/attachment_group/Swapchain.cppm
interface/vulkan/buffer/CubeIndices.cppm
interface/vulkan/buffer/IndirectDrawCommands.cppm
interface/vulkan/descriptor_set_layout/Asset.cppm
interface/vulkan/descriptor_set_layout/ImageBasedLighting.cppm
interface/vulkan/descriptor_set_layout/Scene.cppm
interface/vulkan/descriptor_set_layout/Skybox.cppm
interface/vulkan/Frame.cppm
interface/vulkan/generator/ImageBasedLightingResourceGenerator.cppm
interface/vulkan/generator/MipmappedCubemapGenerator.cppm
interface/vulkan/Gpu.cppm
interface/vulkan/mipmap.cppm
interface/vulkan/pipeline/BlendFacetedPrimitiveRenderer.cppm
interface/vulkan/pipeline/BlendPrimitiveRenderer.cppm
interface/vulkan/pipeline/BlendUnlitPrimitiveRenderer.cppm
interface/vulkan/pipeline/BrdfmapComputer.cppm
interface/vulkan/pipeline/CubemapComputer.cppm
interface/vulkan/pipeline/CubemapToneMappingRenderer.cppm
interface/vulkan/pipeline/DepthRenderer.cppm
interface/vulkan/pipeline/FacetedPrimitiveRenderer.cppm
interface/vulkan/pipeline/JumpFloodComputer.cppm
interface/vulkan/pipeline/JumpFloodSeedRenderer.cppm
interface/vulkan/pipeline/MaskDepthRenderer.cppm
interface/vulkan/pipeline/MaskFacetedPrimitiveRenderer.cppm
interface/vulkan/pipeline/MaskJumpFloodSeedRenderer.cppm
interface/vulkan/pipeline/MaskPrimitiveRenderer.cppm
interface/vulkan/pipeline/MaskUnlitPrimitiveRenderer.cppm
interface/vulkan/pipeline/MultiplyComputer.cppm
interface/vulkan/pipeline/OutlineRenderer.cppm
interface/vulkan/pipeline/PrefilteredmapComputer.cppm
interface/vulkan/pipeline/PrimitiveRenderer.cppm
interface/vulkan/pipeline/SphericalHarmonicCoefficientsSumComputer.cppm
interface/vulkan/pipeline/SphericalHarmonicsComputer.cppm
interface/vulkan/pipeline/SubgroupMipmapComputer.cppm
interface/vulkan/pipeline/SkyboxRenderer.cppm
interface/vulkan/pipeline/tag.cppm
interface/vulkan/pipeline/UnlitPrimitiveRenderer.cppm
interface/vulkan/pipeline/WeightedBlendedCompositionRenderer.cppm
interface/vulkan/pipeline_layout/Primitive.cppm
interface/vulkan/pipeline_layout/PrimitiveNoShading.cppm
interface/vulkan/render_pass/CubemapToneMapping.cppm
interface/vulkan/render_pass/Scene.cppm
interface/vulkan/sampler/BrdfLutSampler.cppm
interface/vulkan/sampler/CubemapSampler.cppm
interface/vulkan/sampler/SingleTexelSampler.cppm
interface/vulkan/SharedData.cppm
)
target_link_libraries(vk-gltf-viewer PRIVATE
Boost::container
CGAL::CGAL
fastgltf::fastgltf
imgui::imgui
KTX::ktx
imguizmo::imguizmo
mikktspace::mikktspace
nfd::nfd
OpenEXR::OpenEXR
vku::vku
)
target_compile_definitions(vk-gltf-viewer PRIVATE
GLFW_INCLUDE_NONE
GLM_FORCE_DEPTH_ZERO_TO_ONE
GLM_FORCE_XYZW_ONLY
GLM_ENABLE_EXPERIMENTAL
GLM_GTC_INLINE_NAMESPACE
GLM_EXT_INLINE_NAMESPACE
GLM_GTX_INLINE_NAMESPACE
)
# --------------------
# Shader compilation.
# --------------------
include(cmake/CompileShader.cmake)
target_link_shaders(vk-gltf-viewer
shaders/blend_faceted_primitive.frag
shaders/blend_primitive.frag
shaders/blend_unlit_primitive.frag
shaders/brdfmap.comp
shaders/cubemap_tone_mapping.frag
shaders/cubemap.comp
shaders/depth.frag
shaders/depth.vert
shaders/faceted_primitive.frag
shaders/faceted_primitive.tesc
shaders/faceted_primitive.tese
shaders/faceted_primitive.vert
shaders/jump_flood_seed.frag
shaders/jump_flood_seed.vert
shaders/jump_flood.comp
shaders/mask_depth.frag
shaders/mask_depth.vert
shaders/mask_faceted_primitive.frag
shaders/mask_jump_flood_seed.frag
shaders/mask_jump_flood_seed.vert
shaders/mask_primitive.frag
shaders/mask_unlit_primitive.frag
shaders/multiply.comp
shaders/outline.frag
shaders/prefilteredmap.comp
shaders/primitive.frag
shaders/primitive.vert
shaders/screen_quad.vert
shaders/skybox.frag
shaders/skybox.vert
shaders/spherical_harmonic_coefficients_sum.comp
shaders/spherical_harmonics.comp
shaders/subgroup_mipmap_16.comp
shaders/subgroup_mipmap_32.comp
shaders/subgroup_mipmap_64.comp
shaders/unlit_primitive.frag
shaders/unlit_primitive.vert
shaders/weighted_blended_composition.frag
)