@@ -61,20 +61,18 @@ namespace nbl::asset::impl
61
61
shaderc_include_result* res = new shaderc_include_result;
62
62
63
63
std::filesystem::path relDir;
64
- #ifdef NBL_EMBED_BUILTIN_RESOURCES
64
+ #ifndef NBL_EMBED_BUILTIN_RESOURCES
65
+ const bool reqBuiltin = false ;
66
+ #else
65
67
const bool reqFromBuiltin = builtin::hasPathPrefix (_requesting_source);
66
68
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).
67
73
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
73
75
relDir = std::filesystem::path (_requesting_source).parent_path ();
74
- }
75
- #else
76
- const bool reqBuiltin = false ;
77
- #endif // NBL_EMBED_BUILTIN_RESOURCES
78
76
std::filesystem::path name = (_type == shaderc_include_type_relative) ? (relDir / _requested_source) : (_requested_source);
79
77
80
78
if (std::filesystem::exists (name) && !reqBuiltin)
0 commit comments