@@ -57,14 +57,17 @@ class ShaderCompiler final : public system::IApplicationFramework
57
57
auto output_flag_pos = std::find (m_arguments.begin (), m_arguments.end (), " -Fo" );
58
58
if (output_flag_pos != m_arguments.end ()) {
59
59
if (output_flag_pos + 1 != m_arguments.end ()) {
60
- output_filepath = *output_flag_pos;
60
+ output_filepath = *( output_flag_pos + 1 ) ;
61
61
m_logger->log (" Compiled shader code will be saved to " + output_filepath);
62
62
m_arguments.erase (output_flag_pos, output_flag_pos+1 );
63
63
}
64
64
else {
65
65
m_logger->log (" Incorrect arguments. Expecting filename after -Fo." , ILogger::ELL_ERROR);
66
66
}
67
67
}
68
+ else {
69
+ m_logger->log (" Missing arguments. Expecting -Fo {filename}." , ILogger::ELL_ERROR);
70
+ }
68
71
69
72
#ifndef NBL_EMBED_BUILTIN_RESOURCES
70
73
if (!no_nbl_builtins) {
@@ -120,7 +123,7 @@ class ShaderCompiler final : public system::IApplicationFramework
120
123
const ICPUShader* open_shader_file (std::string& filepath) {
121
124
122
125
m_assetMgr = make_smart_refctd_ptr<asset::IAssetManager>(smart_refctd_ptr (m_system));
123
- auto resourceArchive = make_smart_refctd_ptr<system::CMountDirectoryArchive>(localInputCWD, smart_refctd_ptr (m_logger), m_system.get ());
126
+ auto resourceArchive = make_smart_refctd_ptr<system::CMountDirectoryArchive>(path ( localInputCWD), logger_opt_smart_ptr ( smart_refctd_ptr (m_logger) ), m_system.get ());
124
127
m_system->mount (std::move (resourceArchive));
125
128
126
129
IAssetLoader::SAssetLoadParams lp = {};
@@ -130,7 +133,7 @@ class ShaderCompiler final : public system::IApplicationFramework
130
133
const auto assets = assetBundle.getContents ();
131
134
if (assets.empty ()) {
132
135
m_logger->log (" Could not load shader %s" , ILogger::ELL_ERROR, filepath);
133
- return false ;
136
+ return nullptr ;
134
137
}
135
138
assert (assets.size () == 1 );
136
139
smart_refctd_ptr<ICPUSpecializedShader> source = IAsset::castDown<ICPUSpecializedShader>(assets[0 ]);
0 commit comments