Skip to content

Commit 1008960

Browse files
committed
Merge remote-tracking branch 'origin' into ali_shader_cache
2 parents f3961db + da92c04 commit 1008960

File tree

130 files changed

+11926
-6284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+11926
-6284
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@
102102
[submodule "3rdparty/imguizmo"]
103103
path = 3rdparty/imguizmo
104104
url = git@github.com:Devsh-Graphics-Programming/ImGuizmo.git
105+
[submodule "3rdparty/imgui_test_engine"]
106+
path = 3rdparty/imgui_test_engine
107+
url = git@github.com:ocornut/imgui_test_engine.git
105108
[submodule "3rdparty/git-version-tracking"]
106109
path = 3rdparty/git-version-tracking
107110
url = git@github.com:Devsh-Graphics-Programming/cmake-git-version-tracking.git

.vsconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "1.0",
3+
"components": [
4+
"Microsoft.VisualStudio.Component.CoreEditor",
5+
"Microsoft.VisualStudio.Workload.CoreEditor",
6+
"Microsoft.Component.MSBuild",
7+
"Microsoft.VisualStudio.Component.VC.CoreIde",
8+
"Microsoft.VisualStudio.Component.Windows10SDK",
9+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
10+
"Microsoft.VisualStudio.Component.Graphics.Tools",
11+
"Microsoft.VisualStudio.Component.VC.DiagnosticTools",
12+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
13+
"Microsoft.VisualStudio.Component.VC.ATL",
14+
"Microsoft.VisualStudio.Component.SecurityIssueAnalysis",
15+
"Microsoft.VisualStudio.Component.VC.ATLMFC",
16+
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
17+
"Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.CMake",
18+
"Microsoft.VisualStudio.Component.VC.CMake.Project",
19+
"Microsoft.VisualStudio.Component.VC.ASAN",
20+
"Microsoft.VisualStudio.Workload.NativeDesktop",
21+
"Microsoft.Net.ComponentGroup.TargetingPacks.Common"
22+
],
23+
"extensions": []
24+
}

3rdparty/CMakeLists.txt

Lines changed: 86 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ option(WITH_JAVA "libjpeg-turbo" OFF)
180180
set(CMAKE_INSTALL_DOCDIR "${CMAKE_CURRENT_BINARY_DIR}/libjpeg-turbo/install/docdir")
181181
set(CMAKE_INSTALL_MANDIR "${CMAKE_CURRENT_BINARY_DIR}/libjpeg-turbo/install/mandir")
182182
add_subdirectory(libjpeg-turbo libjpeg-turbo EXCLUDE_FROM_ALL)
183+
NBL_TARGET_FORCE_ASSEMBLER_EXECUTABLE(simd ASM_NASM libjpeg-turbo/simd/)
184+
183185
unset(CMAKE_INSTALL_DOCDIR)
184186
unset(CMAKE_INSTALL_MANDIR)
185187

@@ -233,9 +235,6 @@ if(_NBL_COMPILE_WITH_OPEN_EXR_)
233235
set(BUILD_TESTING ${_OLD_BUILD_TESTING})
234236
endif()
235237

236-
237-
238-
239238
#gli
240239
option(_NBL_COMPILE_WITH_GLI_ "Build with GLI library" ON)
241240
if(_NBL_COMPILE_WITH_GLI_)
@@ -289,54 +288,113 @@ add_library(spirv_cross OBJECT
289288
target_compile_definitions(spirv_cross PUBLIC SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
290289

291290
# cmake-git-version-tracking
291+
# note that checking if a repository is dirty may cost build time (especially a lot if like us you have a lot of submodules) - by default we run with all checks but if you want to increase build time iterations I recommend to exclude this check
292+
option(GIT_EXCLUDE_IS_DIRTY "Exclude IS_DIRTY from git tracking checks, will increase build time iterations at the expense of the meta information loss" OFF)
292293
add_subdirectory(git-version-tracking EXCLUDE_FROM_ALL)
293294
NBL_ADD_GIT_TRACKING_META_LIBRARY(nabla "${NBL_ROOT_PATH}")
294295
NBL_ADD_GIT_TRACKING_META_LIBRARY(dxc "${CMAKE_CURRENT_SOURCE_DIR}/dxc/dxc")
295296
NBL_GENERATE_GIT_TRACKING_META()
296297

297298
if(NBL_BUILD_IMGUI)
299+
set(NBL_IMGUI_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/imgui")
300+
set(NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT "${THIRD_PARTY_SOURCE_DIR}/imgui_test_engine")
301+
set(NBL_IMGUI_TEST_ENGINE_ROOT "${NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT}/imgui_test_engine")
302+
set(NBL_IMGUI_TEST_SUITE_ROOT "${NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT}/imgui_test_suite")
303+
set(NBL_IMPLOT_ROOT "${NBL_IMGUI_TEST_SUITE_ROOT}/thirdparty/implot")
304+
298305
add_library(imgui STATIC
299-
"imgui/imconfig.h"
300-
"imgui/imgui_demo.cpp"
301-
"imgui/imgui_draw.cpp"
302-
"imgui/imgui_internal.h"
303-
"imgui/imgui_tables.cpp"
304-
"imgui/imgui_widgets.cpp"
305-
"imgui/imgui.cpp"
306-
"imgui/imgui.h"
307-
"imgui/misc/cpp/imgui_stdlib.cpp"
308-
"imgui/misc/cpp/imgui_stdlib.h"
309-
"imgui/imstb_rectpack.h"
310-
"imgui/imstb_textedit.h"
311-
"imgui/imstb_truetype.h"
306+
"${NBL_IMGUI_ROOT}/imconfig.h"
307+
"${NBL_IMGUI_ROOT}/imgui_demo.cpp"
308+
"${NBL_IMGUI_ROOT}/imgui_draw.cpp"
309+
"${NBL_IMGUI_ROOT}/imgui_internal.h"
310+
"${NBL_IMGUI_ROOT}/imgui_tables.cpp"
311+
"${NBL_IMGUI_ROOT}/imgui_widgets.cpp"
312+
"${NBL_IMGUI_ROOT}/imgui.cpp"
313+
"${NBL_IMGUI_ROOT}/misc/freetype/imgui_freetype.cpp"
314+
"${NBL_IMGUI_ROOT}/imgui.h"
315+
"${NBL_IMGUI_ROOT}/misc/cpp/imgui_stdlib.cpp"
316+
"${NBL_IMGUI_ROOT}/misc/cpp/imgui_stdlib.h"
317+
"${NBL_IMGUI_ROOT}/imstb_rectpack.h"
318+
"${NBL_IMGUI_ROOT}/imstb_textedit.h"
319+
"${NBL_IMGUI_ROOT}/imstb_truetype.h"
312320
)
313-
target_include_directories(imgui
314-
PUBLIC "imgui"
315-
PUBLIC "imgui/misc/cpp"
316-
PUBLIC "imgui/backends"
321+
322+
target_link_libraries(imgui PUBLIC freetype)
323+
324+
target_include_directories(imgui PUBLIC
325+
"${NBL_IMGUI_ROOT}"
326+
"${NBL_IMGUI_ROOT}/misc/cpp"
327+
"${NBL_IMGUI_ROOT}/backends"
328+
"${NBL_IMGUI_TEST_SUITE_ROOT}"
329+
$<TARGET_PROPERTY:freetype,INCLUDE_DIRECTORIES>
317330
)
318331

319-
# ImPlot
320332
add_library(implot STATIC
321-
"implot/implot.h"
322-
"implot/implot_internal.h"
323-
"implot/implot.cpp"
324-
"implot/implot_items.cpp"
333+
"${NBL_IMPLOT_ROOT}/implot.h"
334+
"${NBL_IMPLOT_ROOT}/implot_internal.h"
335+
"${NBL_IMPLOT_ROOT}/implot.cpp"
336+
"${NBL_IMPLOT_ROOT}/implot_items.cpp"
337+
"${NBL_IMPLOT_ROOT}/implot_demo.cpp"
325338
)
339+
326340
target_include_directories(implot
327-
PUBLIC "imgui"
341+
PUBLIC $<TARGET_PROPERTY:imgui,INCLUDE_DIRECTORIES>
342+
PUBLIC "${NBL_IMPLOT_ROOT}"
328343
)
344+
329345
target_link_libraries(implot PUBLIC imgui)
330346
target_compile_definitions(implot PUBLIC IMPLOT_DEBUG IMPLOT_DLL_EXPORT)
331-
set_property(TARGET implot PROPERTY CXX_STANDARD 11)
347+
set_target_properties(implot PROPERTIES CXX_STANDARD 20)
348+
332349
if(MSVC)
333350
target_compile_options(implot PRIVATE /MT /W4 /WX /arch:AVX2 /fp:fast /permissive-)
334351
else()
335352
target_compile_options(implot PRIVATE -Wall -Wextra -pedantic -Werror -mavx2 -Ofast)
336353
endif()
354+
355+
file(GLOB_RECURSE NBL_TEST_SUITE_SOURCES CONFIGURE_DEPENDS "${NBL_IMGUI_TEST_SUITE_ROOT}/imgui_test*.cpp")
356+
file(GLOB_RECURSE NBL_TEST_SUITE_SOURCES CONFIGURE_DEPENDS "${NBL_IMGUI_TEST_SUITE_ROOT}/imgui_test*.cpp")
357+
358+
add_library(imtestsuite STATIC
359+
${NBL_TEST_SUITE_SOURCES}
360+
)
361+
362+
target_include_directories(imtestsuite PUBLIC
363+
"${NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT}"
364+
"${NBL_IMGUI_TEST_ENGINE_ROOT}"
365+
"${NBL_IMGUI_TEST_SUITE_ROOT}"
366+
$<TARGET_PROPERTY:imgui,INCLUDE_DIRECTORIES>
367+
$<TARGET_PROPERTY:implot,INCLUDE_DIRECTORIES>
368+
)
369+
370+
set_target_properties(imtestsuite PROPERTIES CXX_STANDARD 14) # NOTE! THOSE TESTS DO NOT COMPILE WITH HIGHER STANDARDS SO WE WRAP SOURCES INTO LIBRARY COMPILED WITH LOWER ONE
371+
target_link_libraries(imtestsuite PUBLIC implot)
372+
373+
file(GLOB_RECURSE NBL_TEST_ENGINE_SOURCES CONFIGURE_DEPENDS "${NBL_IMGUI_TEST_ENGINE_ROOT}/*.cpp")
374+
375+
add_library(imtestengine STATIC
376+
${NBL_TEST_ENGINE_SOURCES}
377+
)
378+
379+
target_include_directories(imtestengine PUBLIC
380+
$<TARGET_PROPERTY:imtestsuite,INCLUDE_DIRECTORIES>
381+
)
382+
383+
target_link_libraries(imtestengine PUBLIC imtestsuite)
337384

338385
set(IMGUIZMO_BUILD_EXAMPLE OFF)
339386
add_subdirectory(imguizmo EXCLUDE_FROM_ALL)
387+
388+
# note we override imgui config with our own
389+
set(NBL_IMGUI_USER_CONFIG_FILEPATH "${NBL_IMGUI_ROOT}/nabla_imconfig.h")
390+
391+
if(NOT EXISTS "${NBL_IMGUI_USER_CONFIG_FILEPATH}")
392+
message(FATAL_ERROR "\"${NBL_IMGUI_USER_CONFIG_FILEPATH}\" doesn't exist!")
393+
endif()
394+
395+
target_compile_definitions(imgui PUBLIC
396+
IMGUI_USER_CONFIG="${NBL_IMGUI_USER_CONFIG_FILEPATH}"
397+
)
340398
endif()
341399

342400
add_library(aesGladman OBJECT
@@ -427,7 +485,7 @@ if (NBL_BUILD_MITSUBA_LOADER)
427485
list(APPEND NBL_3RDPARTY_TARGETS expat)
428486
endif()
429487
if (NBL_BUILD_IMGUI)
430-
list(APPEND NBL_3RDPARTY_TARGETS imgui implot imguizmo)
488+
list(APPEND NBL_3RDPARTY_TARGETS imgui implot imtestsuite imtestengine imguizmo)
431489
endif()
432490
if(ENABLE_HLSL)
433491
list(APPEND NBL_3RDPARTY_TARGETS HLSL)

3rdparty/imgui

Submodule imgui updated 115 files

3rdparty/imgui_test_engine

Submodule imgui_test_engine added at 60b295c

CMakeLists.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ include(ExternalProject)
1313
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchains/android/build.cmake)
1414

1515
project(Nabla LANGUAGES CXX C)
16-
enable_language(C CXX ASM)
16+
enable_language(C CXX ASM ASM_NASM)
17+
18+
if(MSVC)
19+
enable_language(ASM_MASM)
20+
endif()
1721

1822
option(NBL_STATIC_BUILD "" OFF) # ON for static builds, OFF for shared
1923
option(NBL_DYNAMIC_MSVC_RUNTIME "" ON)
@@ -30,7 +34,7 @@ endif()
3034
if(NBL_STATIC_BUILD)
3135
message(STATUS "Static Nabla build enabled!")
3236
else()
33-
if(WIN32 AND MSVC)
37+
if(MSVC)
3438
if(NBL_DYNAMIC_MSVC_RUNTIME)
3539
message(STATUS "Shared Nabla build enabled!")
3640
else()
@@ -66,6 +70,14 @@ set(NBL_BUILTIN_RESOURCES_DIRECTORY_PATH "${NBL_ROOT_PATH}/include/nbl/builtin")
6670
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NBL_ROOT_PATH}/cmake" CACHE PATH "")
6771
get_property(NBL_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
6872

73+
include(common)
74+
75+
option(NBL_ENABLE_VS_CONFIG_IMPORT "Request import of .vsconfig file with VS components required to build Nabla" OFF)
76+
77+
if(NBL_ENABLE_VS_CONFIG_IMPORT)
78+
NBL_IMPORT_VS_CONFIG()
79+
endif()
80+
6981
# Configure CCache if available
7082
find_program(CCACHE_FOUND ccache)
7183
if(CCACHE_FOUND)
@@ -189,7 +201,6 @@ get_filename_component(NBL_MEDIA_DIRECTORY_ABS "${NBL_MEDIA_DIRECTORY}" ABSOLUTE
189201

190202
include(submodules/update)
191203
find_package(Python3 COMPONENTS Interpreter REQUIRED)
192-
include(common)
193204

194205
add_subdirectory(${THIRD_PARTY_SOURCE_DIR})
195206

CMakePresets.json

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"minor": 29,
66
"patch": 2
77
},
8-
98
"configurePresets": [
109
{
1110
"name": "ci-configure-base",
@@ -109,21 +108,27 @@
109108
"inherits": "ci-configure-static-windows-base",
110109
"displayName": "[CI]: Static library target, Ninja multi-config generator",
111110
"description": "Configure as static library with Ninja multi-config generator",
112-
"generator": "Ninja Multi-Config"
111+
"generator": "Ninja Multi-Config",
112+
"cacheVariables": {
113+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
114+
}
113115
},
114116
{
115117
"name": "ci-configure-dynamic-ninja-multi",
116118
"inherits": "ci-configure-dynamic-windows-base",
117119
"displayName": "[CI]: Dynamic library target, Ninja multi-config generator",
118120
"description": "Configure as dynamic library with Ninja multi-config generator",
119-
"generator": "Ninja Multi-Config"
121+
"generator": "Ninja Multi-Config",
122+
"cacheVariables": {
123+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
124+
}
120125
},
121126
{
122127
"name": "user-configure-base",
123128
"hidden": true,
124129
"cacheVariables": {
125130
"NBL_CI_MODE": "OFF",
126-
"NBL_UPDATE_GIT_SUBMODULE": "ON",
131+
"NBL_UPDATE_GIT_SUBMODULE": "OFF",
127132
"NBL_RUN_TESTS": "OFF",
128133
"NBL_CPACK_CI": "OFF"
129134
}
@@ -193,14 +198,20 @@
193198
"inherits": "user-configure-static-windows-base",
194199
"displayName": "[USER]: Static library target, Ninja multi-config generator",
195200
"description": "Configure as static library with Ninja multi-config generator",
196-
"generator": "Ninja Multi-Config"
201+
"generator": "Ninja Multi-Config",
202+
"cacheVariables": {
203+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
204+
}
197205
},
198206
{
199207
"name": "user-configure-dynamic-ninja-multi",
200208
"inherits": "user-configure-dynamic-windows-base",
201209
"displayName": "[USER]: Dynamic library target, Ninja multi-config generator",
202210
"description": "Configure as dynamic library with Ninja multi-config generator",
203-
"generator": "Ninja Multi-Config"
211+
"generator": "Ninja Multi-Config",
212+
"cacheVariables": {
213+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
214+
}
204215
},
205216
{
206217
"name": "user-configure-static-ninja-release",
@@ -209,7 +220,8 @@
209220
"description": "Configure as static Release library with Ninja single-config generator",
210221
"generator": "Ninja",
211222
"cacheVariables": {
212-
"CMAKE_BUILD_TYPE": "Release"
223+
"CMAKE_BUILD_TYPE": "Release",
224+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
213225
}
214226
},
215227
{
@@ -219,7 +231,8 @@
219231
"description": "Configure as dynamic Release library with Ninja single-config generator",
220232
"generator": "Ninja",
221233
"cacheVariables": {
222-
"CMAKE_BUILD_TYPE": "Release"
234+
"CMAKE_BUILD_TYPE": "Release",
235+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
223236
}
224237
},
225238
{
@@ -229,7 +242,8 @@
229242
"description": "Configure as static RelWithDebInfo library with Ninja single-config generator",
230243
"generator": "Ninja",
231244
"cacheVariables": {
232-
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
245+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
246+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
233247
}
234248
},
235249
{
@@ -239,7 +253,8 @@
239253
"description": "Configure as dynamic RelWithDebInfo library with Ninja single-config generator",
240254
"generator": "Ninja",
241255
"cacheVariables": {
242-
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
256+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
257+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
243258
}
244259
},
245260
{
@@ -249,7 +264,8 @@
249264
"description": "Configure as static Debug library with Ninja single-config generator",
250265
"generator": "Ninja",
251266
"cacheVariables": {
252-
"CMAKE_BUILD_TYPE": "Debug"
267+
"CMAKE_BUILD_TYPE": "Debug",
268+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
253269
}
254270
},
255271
{
@@ -259,7 +275,8 @@
259275
"description": "Configure as dynamic Debug library with Ninja single-config generator",
260276
"generator": "Ninja",
261277
"cacheVariables": {
262-
"CMAKE_BUILD_TYPE": "Debug"
278+
"CMAKE_BUILD_TYPE": "Debug",
279+
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
263280
}
264281
}
265282
],
@@ -413,7 +430,6 @@
413430
"displayName": "[USER]: Dynamic Debug library target, Ninja single-config generator",
414431
"description": "Build Nabla as dynamic Debug library with Ninja single-config generator"
415432
}
416-
417433
],
418434
"packagePresets": [
419435
{

0 commit comments

Comments
 (0)