Skip to content

Commit a4e40f8

Browse files
committed
Make Nabla compile with NBL_EMBED_BUILTIN_RESOURCES turned OFF, update examples_tests submodule
1 parent 49fce1d commit a4e40f8

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

examples_tests

src/nbl/asset/utils/CGLSLCompiler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// For conditions of distribution and use, see copyright notice in nabla.h
44
#include "nbl/asset/utils/CGLSLCompiler.h"
55
#include "nbl/asset/utils/shadercUtils.h"
6+
#ifdef _NBL_EMBED_BUILTIN_RESOURCES_
67
#include "nbl/builtin/CArchive.h"
8+
#endif // _NBL_EMBED_BUILTIN_RESOURCES_
79

810
#include <sstream>
911
#include <regex>
@@ -57,6 +59,7 @@ namespace nbl::asset::impl
5759
std::string res_str;
5860

5961
std::filesystem::path relDir;
62+
#ifdef _NBL_EMBED_BUILTIN_RESOURCES_
6063
const bool reqFromBuiltin = builtin::hasPathPrefix(_requesting_source);
6164
const bool reqBuiltin = builtin::hasPathPrefix(_requested_source);
6265
if (!reqFromBuiltin && !reqBuiltin)
@@ -67,6 +70,9 @@ namespace nbl::asset::impl
6770
// or path relative to executable's working directory (""-type).
6871
relDir = std::filesystem::path(_requesting_source).parent_path();
6972
}
73+
#else
74+
const bool reqBuiltin = false;
75+
#endif // _NBL_EMBED_BUILTIN_RESOURCES_
7076
std::filesystem::path name = (_type == shaderc_include_type_relative) ? (relDir / _requested_source) : (_requested_source);
7177

7278
if (std::filesystem::exists(name) && !reqBuiltin)

src/nbl/asset/utils/CHLSLCompiler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
// For conditions of distribution and use, see copyright notice in nabla.h
44
#include "nbl/asset/utils/CHLSLCompiler.h"
55
#include "nbl/asset/utils/shadercUtils.h"
6+
#ifdef _NBL_EMBED_BUILTIN_RESOURCES_
67
#include "nbl/builtin/CArchive.h"
8+
#endif // _NBL_EMBED_BUILTIN_RESOURCES_
79

810

911
#ifdef _NBL_PLATFORM_WINDOWS_
@@ -73,6 +75,7 @@ static tcpp::IInputStream* getInputStreamInclude(
7375
std::string res_str;
7476

7577
std::filesystem::path relDir;
78+
#ifdef _NBL_EMBED_BUILTIN_RESOURCES_
7679
const bool reqFromBuiltin = builtin::hasPathPrefix(requestingSource);
7780
const bool reqBuiltin = builtin::hasPathPrefix(requestedSource);
7881
if (!reqFromBuiltin && !reqBuiltin)
@@ -83,6 +86,9 @@ static tcpp::IInputStream* getInputStreamInclude(
8386
// or path relative to executable's working directory (""-type).
8487
relDir = std::filesystem::path(requestingSource).parent_path();
8588
}
89+
#else
90+
const bool reqBuiltin = false;
91+
#endif // _NBL_EMBED_BUILTIN_RESOURCES_
8692
std::filesystem::path name = isRelative ? (relDir / requestedSource) : (requestedSource);
8793

8894
if (std::filesystem::exists(name) && !reqBuiltin)

src/nbl/system/ISystem.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#include "nbl/system/ISystem.h"
22
#include "nbl/system/ISystemFile.h"
33
#include "nbl/system/CFileView.h"
4+
#ifdef _NBL_EMBED_BUILTIN_RESOURCES_
45
#include "nbl/builtin/CArchive.h"
6+
#endif // _NBL_EMBED_BUILTIN_RESOURCES_
57

68
#include "nbl/system/CArchiveLoaderZip.h"
79
#include "nbl/system/CArchiveLoaderTar.h"
@@ -18,7 +20,7 @@ ISystem::ISystem(core::smart_refctd_ptr<ISystem::ICaller>&& caller) : m_dispatch
1820
#ifdef _NBL_EMBED_BUILTIN_RESOURCES_
1921
mount(core::make_smart_refctd_ptr<nbl::builtin::CArchive>(nullptr));
2022
#else
21-
mount(core::make_smart_refctd_ptr<nbl::system::CMountDirectoryArchive>(NBL_BUILTIN_RESOURCES_DIRECTORY_PATH, nullptr), "nbl/builtin");
23+
mount(core::make_smart_refctd_ptr<nbl::system::CMountDirectoryArchive>(NBL_BUILTIN_RESOURCES_DIRECTORY_PATH, nullptr, this), "nbl/builtin");
2224
#endif
2325
}
2426

0 commit comments

Comments
 (0)