Skip to content

Commit dada0d3

Browse files
Erfan-AhmadiFletterioAnastaZIuk
authored
Merge Fixes for Geotex streaming#952 (#1002)
* Fix so that code can run in examples branch * update examples * update examples * ieee754::flipSign update, flipSign_helper::FloatingPoint fix * Change examples submodule * Update submodule pointer * Update CMakePresets.json, forgot to commit and push new n4ce preset * update examples * asset::IShaderCompiler::E_DEBUG_INFO_FLAGS::EDIF_NONE for NSC * add debug info flags to ILogicalDevice::compileShader * Point submodule to geotex branch * IUtilities Allow for null (0 sized) staging buffers for download/upload * Cmake "NBL_SKIP_BUILD_OPTIONS_VALIDATION": "ON" * Small MonoDeviceApp fix and update examples * update examples * Update Vulkan-Headers to 1.4.332 * update 3rdparty/Vulkan-Tools] * update smoke test to cover n4ce case, update 3rdparty/SPIRV-Tools submodule * add include/nbl/system/json.h and wipe nlohmann/json_fwd.hpp from public header interface * fix json ambiguity, update examples_tests submodule * update examples * update examples * update merged examples * update examples * Change submodule pointer to point to tgeotex streaming * update merged examples * after merge fixes * Update examples_tests pointer for CAD fix * Shorten resource archive output path * update examples * Split module load paths for build and relocatable package * Prioritize env and relative paths in relocatable package mode * update examples * update examples tests --------- Co-authored-by: Fletterio <[email protected]> Co-authored-by: Arkadiusz Lachowicz <[email protected]> Co-authored-by: Arkadiusz Lachowicz <[email protected]>
1 parent a53f301 commit dada0d3

21 files changed

Lines changed: 406 additions & 243 deletions

File tree

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
}

include/nbl/system/IApplicationFramework.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,19 @@ class IApplicationFramework : public core::IReferenceCounted
114114
return true;
115115
};
116116

117-
if (not load(module.dxc, { install.dxc, env.dxc, build.dxc, rel.dxc }))
117+
#ifdef NBL_RELOCATABLE_PACKAGE
118+
if (not load(module.dxc, { env.dxc, rel.dxc, install.dxc }))
119+
#else
120+
if (not load(module.dxc, { build.dxc }))
121+
#endif
118122
return false;
119123

120124
#ifdef _NBL_SHARED_BUILD_
121-
if (not load(module.nabla, { install.nabla, env.nabla, build.nabla, rel.nabla }))
125+
#ifdef NBL_RELOCATABLE_PACKAGE
126+
if (not load(module.nabla, { env.nabla, rel.nabla, install.nabla }))
127+
#else
128+
if (not load(module.nabla, { build.nabla }))
129+
#endif
122130
return false;
123131
#endif
124132

@@ -234,4 +242,4 @@ class IApplicationFramework : public core::IReferenceCounted
234242
}
235243
#endif
236244

237-
#endif
245+
#endif

0 commit comments

Comments
 (0)