Skip to content

Commit 0c9dfca

Browse files
committed
Merge branch 'master' into ali_lib_shader
2 parents 52db910 + f4b2626 commit 0c9dfca

File tree

301 files changed

+18730
-8839
lines changed

Some content is hidden

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

301 files changed

+18730
-8839
lines changed

.gitmodules

Lines changed: 6 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
@@ -111,3 +114,6 @@
111114
[submodule "3rdparty/libdeflate"]
112115
path = 3rdparty/libdeflate
113116
url = git@github.com:Devsh-Graphics-Programming/libdeflate.git
117+
[submodule "docker/compiler-explorer"]
118+
path = docker/compiler-explorer
119+
url = git@github.com:Devsh-Graphics-Programming/Compiler-Explorer-Docker.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: 101 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ set(_OLD_SKIP_INSTALL_ALL ${SKIP_INSTALL_ALL})
9090
set(BUILD_SHARED_LIBS OFF)
9191
set(SKIP_INSTALL_ALL ON)
9292

93-
add_subdirectory(zlib zlib EXCLUDE_FROM_ALL)
9493
file(LOCK "${CMAKE_CURRENT_SOURCE_DIR}/zlib" DIRECTORY GUARD PROCESS RESULT_VARIABLE NBL_LOCK TIMEOUT 60)
94+
add_subdirectory(zlib zlib EXCLUDE_FROM_ALL)
9595
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/zlib/zconf.h.included")
9696
execute_process(COMMAND "${CMAKE_COMMAND}" -E rename zconf.h.included zconf.h
9797
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/zlib"
@@ -161,11 +161,6 @@ target_include_directories(SPIRV PUBLIC "${GLSLANG_GENERATED_INCLUDEDIR}")
161161
set(SHADERC_SKIP_TESTS ON CACHE INTERNAL "Skip shaderc tests?")
162162
set(SHADERC_SKIP_INSTALL ON CACHE INTERNAL "Install shaderc?")
163163

164-
# if it doesn't work without the `touch` on Linux, then fetch the latest submodule head of shaderc and try again
165-
# https://github.com/google/shaderc/issues/568
166-
if (UNIX)
167-
file(WRITE ${THIRD_PARTY_SOURCE_DIR}/shaderc/libshaderc/libshaderc_combined.a "")
168-
endif()
169164
add_subdirectory(shaderc shaderc EXCLUDE_FROM_ALL)
170165

171166
# libjpeg-turbo
@@ -180,6 +175,8 @@ option(WITH_JAVA "libjpeg-turbo" OFF)
180175
set(CMAKE_INSTALL_DOCDIR "${CMAKE_CURRENT_BINARY_DIR}/libjpeg-turbo/install/docdir")
181176
set(CMAKE_INSTALL_MANDIR "${CMAKE_CURRENT_BINARY_DIR}/libjpeg-turbo/install/mandir")
182177
add_subdirectory(libjpeg-turbo libjpeg-turbo EXCLUDE_FROM_ALL)
178+
NBL_TARGET_FORCE_ASSEMBLER_EXECUTABLE(simd ASM_NASM libjpeg-turbo/simd/)
179+
183180
unset(CMAKE_INSTALL_DOCDIR)
184181
unset(CMAKE_INSTALL_MANDIR)
185182

@@ -234,8 +231,6 @@ if(_NBL_COMPILE_WITH_OPEN_EXR_)
234231
endif()
235232

236233

237-
238-
239234
#gli
240235
option(_NBL_COMPILE_WITH_GLI_ "Build with GLI library" ON)
241236
if(_NBL_COMPILE_WITH_GLI_)
@@ -289,54 +284,125 @@ add_library(spirv_cross OBJECT
289284
target_compile_definitions(spirv_cross PUBLIC SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
290285

291286
# cmake-git-version-tracking
287+
# 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
288+
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)
292289
add_subdirectory(git-version-tracking EXCLUDE_FROM_ALL)
293290
NBL_ADD_GIT_TRACKING_META_LIBRARY(nabla "${NBL_ROOT_PATH}")
294291
NBL_ADD_GIT_TRACKING_META_LIBRARY(dxc "${CMAKE_CURRENT_SOURCE_DIR}/dxc/dxc")
295292
NBL_GENERATE_GIT_TRACKING_META()
296293

294+
# NGFX
295+
include(ngfx/ngfx.cmake)
296+
297297
if(NBL_BUILD_IMGUI)
298+
set(NBL_IMGUI_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/imgui")
299+
set(NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT "${THIRD_PARTY_SOURCE_DIR}/imgui_test_engine")
300+
set(NBL_IMGUI_TEST_ENGINE_ROOT "${NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT}/imgui_test_engine")
301+
set(NBL_IMGUI_TEST_SUITE_ROOT "${NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT}/imgui_test_suite")
302+
set(NBL_IMPLOT_ROOT "${NBL_IMGUI_TEST_SUITE_ROOT}/thirdparty/implot")
303+
298304
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"
305+
"${NBL_IMGUI_ROOT}/imconfig.h"
306+
"${NBL_IMGUI_ROOT}/imgui_demo.cpp"
307+
"${NBL_IMGUI_ROOT}/imgui_draw.cpp"
308+
"${NBL_IMGUI_ROOT}/imgui_internal.h"
309+
"${NBL_IMGUI_ROOT}/imgui_tables.cpp"
310+
"${NBL_IMGUI_ROOT}/imgui_widgets.cpp"
311+
"${NBL_IMGUI_ROOT}/imgui.cpp"
312+
"${NBL_IMGUI_ROOT}/misc/freetype/imgui_freetype.cpp"
313+
"${NBL_IMGUI_ROOT}/imgui.h"
314+
"${NBL_IMGUI_ROOT}/misc/cpp/imgui_stdlib.cpp"
315+
"${NBL_IMGUI_ROOT}/misc/cpp/imgui_stdlib.h"
316+
"${NBL_IMGUI_ROOT}/imstb_rectpack.h"
317+
"${NBL_IMGUI_ROOT}/imstb_textedit.h"
318+
"${NBL_IMGUI_ROOT}/imstb_truetype.h"
312319
)
313-
target_include_directories(imgui
314-
PUBLIC "imgui"
315-
PUBLIC "imgui/misc/cpp"
316-
PUBLIC "imgui/backends"
320+
321+
target_link_libraries(imgui PUBLIC freetype)
322+
323+
target_include_directories(imgui PUBLIC
324+
"${NBL_IMGUI_ROOT}"
325+
"${NBL_IMGUI_ROOT}/misc/cpp"
326+
"${NBL_IMGUI_ROOT}/backends"
327+
"${NBL_IMGUI_TEST_SUITE_ROOT}"
328+
$<TARGET_PROPERTY:freetype,INCLUDE_DIRECTORIES>
317329
)
318330

319-
# ImPlot
320331
add_library(implot STATIC
321-
"implot/implot.h"
322-
"implot/implot_internal.h"
323-
"implot/implot.cpp"
324-
"implot/implot_items.cpp"
332+
"${NBL_IMPLOT_ROOT}/implot.h"
333+
"${NBL_IMPLOT_ROOT}/implot_internal.h"
334+
"${NBL_IMPLOT_ROOT}/implot.cpp"
335+
"${NBL_IMPLOT_ROOT}/implot_items.cpp"
336+
"${NBL_IMPLOT_ROOT}/implot_demo.cpp"
325337
)
338+
326339
target_include_directories(implot
327-
PUBLIC "imgui"
340+
PUBLIC $<TARGET_PROPERTY:imgui,INCLUDE_DIRECTORIES>
341+
PUBLIC "${NBL_IMPLOT_ROOT}"
328342
)
343+
329344
target_link_libraries(implot PUBLIC imgui)
330345
target_compile_definitions(implot PUBLIC IMPLOT_DEBUG IMPLOT_DLL_EXPORT)
331-
set_property(TARGET implot PROPERTY CXX_STANDARD 11)
346+
set_target_properties(implot PROPERTIES CXX_STANDARD 20)
347+
332348
if(MSVC)
333349
target_compile_options(implot PRIVATE /MT /W4 /WX /arch:AVX2 /fp:fast /permissive-)
334350
else()
335351
target_compile_options(implot PRIVATE -Wall -Wextra -pedantic -Werror -mavx2 -Ofast)
336352
endif()
353+
354+
file(GLOB_RECURSE NBL_TEST_SUITE_SOURCES CONFIGURE_DEPENDS "${NBL_IMGUI_TEST_SUITE_ROOT}/imgui_test*.cpp")
355+
file(GLOB_RECURSE NBL_TEST_SUITE_SOURCES CONFIGURE_DEPENDS "${NBL_IMGUI_TEST_SUITE_ROOT}/imgui_test*.cpp")
356+
357+
add_library(imtestsuite STATIC
358+
${NBL_TEST_SUITE_SOURCES}
359+
)
337360

338-
set(IMGUIZMO_BUILD_EXAMPLE OFF)
339-
add_subdirectory(imguizmo EXCLUDE_FROM_ALL)
361+
target_include_directories(imtestsuite PUBLIC
362+
"${NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT}"
363+
"${NBL_IMGUI_TEST_ENGINE_ROOT}"
364+
"${NBL_IMGUI_TEST_SUITE_ROOT}"
365+
$<TARGET_PROPERTY:imgui,INCLUDE_DIRECTORIES>
366+
$<TARGET_PROPERTY:implot,INCLUDE_DIRECTORIES>
367+
)
368+
369+
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
370+
target_link_libraries(imtestsuite PUBLIC implot)
371+
372+
file(GLOB_RECURSE NBL_TEST_ENGINE_SOURCES CONFIGURE_DEPENDS "${NBL_IMGUI_TEST_ENGINE_ROOT}/*.cpp")
373+
374+
add_library(imtestengine STATIC
375+
${NBL_TEST_ENGINE_SOURCES}
376+
)
377+
378+
target_include_directories(imtestengine PUBLIC
379+
$<TARGET_PROPERTY:imtestsuite,INCLUDE_DIRECTORIES>
380+
)
381+
382+
target_link_libraries(imtestengine PUBLIC imtestsuite)
383+
384+
# imguizmo
385+
add_library(imguizmo
386+
"${CMAKE_CURRENT_SOURCE_DIR}/imguizmo/GraphEditor.cpp"
387+
"${CMAKE_CURRENT_SOURCE_DIR}/imguizmo/ImCurveEdit.cpp"
388+
"${CMAKE_CURRENT_SOURCE_DIR}/imguizmo/ImGradient.cpp"
389+
"${CMAKE_CURRENT_SOURCE_DIR}/imguizmo/ImGuizmo.cpp"
390+
"${CMAKE_CURRENT_SOURCE_DIR}/imguizmo/ImSequencer.cpp"
391+
)
392+
393+
target_include_directories(imguizmo PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/imguizmo>)
394+
target_link_libraries(imguizmo PUBLIC imgui)
395+
396+
# note we override imgui config with our own
397+
set(NBL_IMGUI_USER_CONFIG_FILEPATH "${NBL_IMGUI_ROOT}/nabla_imconfig.h")
398+
399+
if(NOT EXISTS "${NBL_IMGUI_USER_CONFIG_FILEPATH}")
400+
message(FATAL_ERROR "\"${NBL_IMGUI_USER_CONFIG_FILEPATH}\" doesn't exist!")
401+
endif()
402+
403+
target_compile_definitions(imgui PUBLIC
404+
IMGUI_USER_CONFIG="${NBL_IMGUI_USER_CONFIG_FILEPATH}"
405+
)
340406
endif()
341407

342408
add_library(aesGladman OBJECT
@@ -403,7 +469,6 @@ set(NBL_3RDPARTY_TARGETS
403469
simdjson
404470
nlohmann_json
405471
glslang
406-
OGLCompiler
407472
OSDependent
408473
MachineIndependent
409474
GenericCodeGen
@@ -427,10 +492,7 @@ if (NBL_BUILD_MITSUBA_LOADER)
427492
list(APPEND NBL_3RDPARTY_TARGETS expat)
428493
endif()
429494
if (NBL_BUILD_IMGUI)
430-
list(APPEND NBL_3RDPARTY_TARGETS imgui implot imguizmo)
431-
endif()
432-
if(ENABLE_HLSL)
433-
list(APPEND NBL_3RDPARTY_TARGETS HLSL)
495+
list(APPEND NBL_3RDPARTY_TARGETS imgui implot imtestsuite imtestengine imguizmo)
434496
endif()
435497

436498
foreach(trgt IN LISTS NBL_3RDPARTY_TARGETS)

3rdparty/Vulkan-Headers

Submodule Vulkan-Headers updated 84 files

3rdparty/dxc/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
option(NBL_LLVM_ENABLE_ASSERTIONS "LLVM_ENABLE_ASSERTIONS" ON)
2+
3+
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DLLVM_ENABLE_ASSERTIONS:BOOL=${NBL_LLVM_ENABLE_ASSERTIONS}")
14
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DHLSL_OPTIONAL_PROJS_IN_DEFAULT:BOOL=OFF")
25
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DHLSL_ENABLE_ANALYZE:BOOL=OFF")
36
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DHLSL_OFFICIAL_BUILD:BOOL=OFF")

3rdparty/dxc/dxc

Submodule dxc updated 247 files

3rdparty/glslang

3rdparty/imgui

Submodule imgui updated 115 files

3rdparty/imgui_test_engine

Submodule imgui_test_engine added at 60b295c

0 commit comments

Comments
 (0)