Skip to content

Commit 3c75ba5

Browse files
author
devsh
committed
turns out CGLSLCompiler::preprocessShader didn't quite work right for NBL_EMBED_BUILTIN_RESOURCES=OFF
1 parent 1d9658e commit 3c75ba5

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/nbl/asset/utils/CGLSLCompiler.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,18 @@ namespace nbl::asset::impl
6161
shaderc_include_result* res = new shaderc_include_result;
6262

6363
std::filesystem::path relDir;
64-
#ifdef NBL_EMBED_BUILTIN_RESOURCES
64+
#ifndef NBL_EMBED_BUILTIN_RESOURCES
65+
const bool reqBuiltin = false;
66+
#else
6567
const bool reqFromBuiltin = builtin::hasPathPrefix(_requesting_source);
6668
const bool reqBuiltin = builtin::hasPathPrefix(_requested_source);
69+
//While #includ'ing a builtin, one must specify its full path (starting with "nbl/builtin" or "/nbl/builtin").
70+
// This rule applies also while a builtin is #includ`ing another builtin.
71+
//While including a filesystem file it must be either absolute path (or relative to any search dir added to asset::iIncludeHandler; <>-type),
72+
// or path relative to executable's working directory (""-type).
6773
if (!reqFromBuiltin && !reqBuiltin)
68-
{
69-
//While #includ'ing a builtin, one must specify its full path (starting with "nbl/builtin" or "/nbl/builtin").
70-
// This rule applies also while a builtin is #includ`ing another builtin.
71-
//While including a filesystem file it must be either absolute path (or relative to any search dir added to asset::iIncludeHandler; <>-type),
72-
// or path relative to executable's working directory (""-type).
74+
#endif // NBL_EMBED_BUILTIN_RESOURCES
7375
relDir = std::filesystem::path(_requesting_source).parent_path();
74-
}
75-
#else
76-
const bool reqBuiltin = false;
77-
#endif // NBL_EMBED_BUILTIN_RESOURCES
7876
std::filesystem::path name = (_type == shaderc_include_type_relative) ? (relDir / _requested_source) : (_requested_source);
7977

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

0 commit comments

Comments
 (0)