Skip to content

Commit 76b761e

Browse files
Merge branch 'master' of github.com:Devsh-Graphics-Programming/Nabla
2 parents f2c60f4 + d7980d7 commit 76b761e

22 files changed

Lines changed: 432 additions & 254 deletions

File tree

.github/workflows/build-nabla.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
matrix:
3232
# vendor: [msvc, clangcl]
3333
# TODO: Yas please fix ClangCL, we have a few new compile errors
34-
# if we build MSVC then build "run-compiler-explorer" target, for ClangCL build just "nsc"
34+
# build full Nabla preset, run-compiler-explorer is pulled in via ALL when Docker integration is enabled
3535
vendor: [msvc]
3636
config: [Release, Debug, RelWithDebInfo]
3737
tag: ['17.13.6']
@@ -122,22 +122,17 @@ jobs:
122122
docker exec orphan `
123123
${{ env.entry }} ${{ env.cmd }} -Command cmake `
124124
--preset ci-configure-dynamic-${{ matrix.vendor }} `
125+
-DCMAKE_INSTALL_PREFIX:PATH=C:/mount/nabla/build-ct/install `
125126
--profiling-output=profiling/cmake-profiling.json `
126127
--profiling-format=google-trace
127128
128-
- name: Container – Build NSC
129+
- name: Container – Build & Install Nabla
129130
run: |
130131
docker exec orphan `
131132
${{ env.entry }} ${{ env.cmd }} -Command cmake --build `
132133
--preset ci-build-dynamic-${{ matrix.vendor }} `
133-
-t run-compiler-explorer --config ${{ matrix.config }}
134-
135-
- name: Container – Install Nabla
136-
run: |
137-
docker exec orphan `
138-
${{ env.entry }} ${{ env.cmd }} -Command cmake --install `
139-
${{ env.binary }} --config ${{ matrix.config }} `
140-
--prefix ${{ env.install }}
134+
--target install `
135+
--config ${{ matrix.config }}
141136
142137
- name: API / Examples / Check Run (Create)
143138
id: check-run-create
@@ -397,4 +392,4 @@ jobs:
397392
run: cmake --build smoke/out --config ${{ matrix.config }}
398393

399394
- name: CTest Smoke
400-
run: ctest --verbose --test-dir smoke/out --force-new-ctest-process --output-on-failure --no-tests=error -C ${{ matrix.config }}
395+
run: ctest --verbose --test-dir smoke/out --force-new-ctest-process --output-on-failure --no-tests=error -C ${{ matrix.config }}

3rdparty/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,6 @@ nbl_install_dir(imath/src/Imath)
530530

531531
nbl_install_file(blake/c/blake3.h)
532532

533-
nbl_install_file_spec(nlohmann_json/include/nlohmann/json_fwd.hpp nlohmann)
534-
nbl_install_file_spec(nlohmann_json/include/nlohmann/detail/abi_macros.hpp nlohmann/detail)
535-
536533
nbl_install_dir(boost/superproject/libs/preprocessor/include/boost)
537534

538535
nbl_install_file_spec(renderdoc/renderdoc_app.h renderdoc)

CMakePresets.json

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,32 @@
295295
"CMAKE_BUILD_TYPE": "Debug",
296296
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
297297
}
298-
}
298+
},
299+
{
300+
"name": "n4ce-configure-windows-msvc",
301+
"hidden": false,
302+
"binaryDir": "build/production/n4ce",
303+
"cacheVariables": {
304+
"NBL_STATIC_BUILD": "OFF",
305+
"NBL_SKIP_BUILD_OPTIONS_VALIDATION": "ON",
306+
"CMAKE_SUPPRESS_REGENERATION": "OFF",
307+
"NBL_COMPILER_DYNAMIC_RUNTIME": "ON",
308+
"NBL_EMBED_BUILTIN_RESOURCES": "ON",
309+
"NBL_UPDATE_GIT_SUBMODULE": "OFF",
310+
"NBL_COMPILE_WITH_CUDA": "OFF",
311+
"NBL_BUILD_OPTIX": "OFF",
312+
"NBL_BUILD_MITSUBA_LOADER": "OFF",
313+
"NBL_BUILD_RADEON_RAYS": "OFF",
314+
"_NBL_COMPILE_WITH_OPEN_EXR_": "ON",
315+
"NBL_EXPLICIT_MODULE_LOAD_LOG": "ON",
316+
"NBL_CPACK_NO_BUILD_DIRECTORY_MODULES": "ON",
317+
"GIT_FAIL_IF_NONZERO_EXIT": "OFF"
318+
},
319+
"displayName": "[N4CE]: Dynamic library target, Visual Studio 17 2022 generator, MSVC v143 toolset",
320+
"description": "Configure as dynamic library with Visual Studio 17 2022 generator and MSVC v143 toolset",
321+
"generator": "Visual Studio 17 2022",
322+
"toolset": "v143"
323+
}
299324
],
300325
"buildPresets": [
301326
{

cmake/common.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,11 @@ function(NBL_CREATE_RESOURCE_ARCHIVE)
16561656
return()
16571657
endif()
16581658

1659-
set(IMPL_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${IMPL_TARGET}")
1659+
if(DEFINED NBL_ROOT_PATH_BINARY AND NBL_ROOT_PATH_BINARY)
1660+
set(IMPL_OUTPUT_DIRECTORY "${NBL_ROOT_PATH_BINARY}/${IMPL_TARGET}")
1661+
else()
1662+
set(IMPL_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${IMPL_TARGET}")
1663+
endif()
16601664

16611665
set(_BUNDLE_ARCHIVE_ABSOLUTE_PATH_ "")
16621666
get_filename_component(_BUNDLE_SEARCH_DIRECTORY_ "${IMPL_BIND}" ABSOLUTE)

examples_tests

include/nbl/application_templates/MonoDeviceApplication.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class MonoDeviceApplication : public virtual MonoSystemMonoLoggerApplication
2424
virtual bool onAppTerminated() override
2525
{
2626
// break the circular references from queues tracking submit resources
27-
m_device->waitIdle();
27+
if (m_device)
28+
m_device->waitIdle();
2829
m_device = nullptr;
2930
m_api = nullptr;
3031
return base_t::onAppTerminated();

include/nbl/asset/utils/IShaderCompiler.h

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313
#include "nbl/asset/IShader.h"
1414
#include "nbl/asset/utils/ISPIRVOptimizer.h"
15-
16-
// Less leakage than "nlohmann/json.hpp" only forward declarations
17-
#include "nlohmann/json_fwd.hpp"
15+
#include "nbl/system/json.h"
1816

1917
#include "nbl/builtin/hlsl/enums.hlsl"
2018

@@ -111,11 +109,10 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
111109
//
112110
struct SMacroDefinition
113111
{
114-
friend void to_json(nlohmann::json&, const SMacroDefinition&);
115-
friend void from_json(const nlohmann::json&, SMacroDefinition&);
116-
117112
std::string_view identifier;
118113
std::string_view definition;
114+
115+
friend struct system::json::adl_serializer<SMacroDefinition>;
119116
};
120117

121118
//
@@ -222,9 +219,8 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
222219
inline bool isStandardInclude() const { return standardInclude; }
223220

224221
private:
225-
friend void to_json(nlohmann::json& j, const SEntry::SPreprocessingDependency& dependency);
226-
friend void from_json(const nlohmann::json& j, SEntry::SPreprocessingDependency& dependency);
227222
friend class CCache;
223+
friend struct system::json::adl_serializer<SEntry::SPreprocessingDependency>;
228224

229225
// path or identifier
230226
system::path requestingSourceDir = "";
@@ -258,8 +254,7 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
258254
friend class SCompilerArgs;
259255
friend class SEntry;
260256
friend class CCache;
261-
friend void to_json(nlohmann::json&, const SPreprocessorArgs&);
262-
friend void from_json(const nlohmann::json&, SPreprocessorArgs&);
257+
friend struct system::json::adl_serializer<SPreprocessorArgs>;
263258

264259
// Default constructor needed for json serialization of SCompilerArgs
265260
SPreprocessorArgs() {};
@@ -301,8 +296,7 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
301296
private:
302297
friend class SEntry;
303298
friend class CCache;
304-
friend void to_json(nlohmann::json&, const SCompilerArgs&);
305-
friend void from_json(const nlohmann::json&, SCompilerArgs&);
299+
friend struct system::json::adl_serializer<SCompilerArgs>;
306300

307301
// Default constructor needed for json serialization of SEntry
308302
SCompilerArgs() {}

include/nbl/builtin/hlsl/ieee754.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ struct flipSignIfRHSNegative_helper<Vectorial, FloatingPoint NBL_PARTIAL_REQ_BOT
261261
};
262262
}
263263

264-
template <typename T, typename U>
265-
NBL_CONSTEXPR_FUNC T flipSign(T val, U flip)
264+
template <typename T, typename U = bool>
265+
NBL_CONSTEXPR_FUNC T flipSign(T val, U flip = true)
266266
{
267267
return impl::flipSign_helper<T, U>::__call(val, flip);
268268
}

0 commit comments

Comments
 (0)