@@ -55,18 +55,22 @@ class ShaderCompiler final : public system::IApplicationFramework
55
55
}
56
56
57
57
auto output_flag_pos = std::find (m_arguments.begin (), m_arguments.end (), " -Fo" );
58
- if (output_flag_pos != m_arguments.end ()) {
59
- if (output_flag_pos + 1 != m_arguments.end ()) {
60
- output_filepath = *(output_flag_pos + 1 );
61
- m_logger->log (" Compiled shader code will be saved to " + output_filepath);
62
- m_arguments.erase (output_flag_pos, output_flag_pos+1 );
63
- }
64
- else {
65
- m_logger->log (" Incorrect arguments. Expecting filename after -Fo." , ILogger::ELL_ERROR);
66
- }
58
+ if (output_flag_pos != m_arguments.end ())
59
+ output_flag_pos = std::find (m_arguments.begin (), m_arguments.end (), " -Fc" );
60
+
61
+ if (output_flag_pos == m_arguments.end ()) {
62
+ m_logger->log (" Missing arguments. Expecting `-Fo {filename}` or `-Fc {filename}`." , ILogger::ELL_ERROR);
63
+ return false ;
64
+ }
65
+
66
+ if (output_flag_pos + 1 != m_arguments.end ()) {
67
+ output_filepath = *(output_flag_pos + 1 );
68
+ m_logger->log (" Compiled shader code will be saved to " + output_filepath);
69
+ m_arguments.erase (output_flag_pos, output_flag_pos+1 );
67
70
}
68
71
else {
69
- m_logger->log (" Missing arguments. Expecting -Fo {filename}." , ILogger::ELL_ERROR);
72
+ m_logger->log (" Incorrect arguments. Expecting filename after -Fo or -Fc." , ILogger::ELL_ERROR);
73
+ return false ;
70
74
}
71
75
72
76
#ifndef NBL_EMBED_BUILTIN_RESOURCES
@@ -91,11 +95,12 @@ class ShaderCompiler final : public system::IApplicationFramework
91
95
output_file.write ((const char *)compilation_result->getContent ()->getPointer (), compilation_result->getContent ()->getSize ());
92
96
output_file.close ();
93
97
m_logger->log (" Shader compilation successful." );
98
+ return true ;
94
99
}
95
100
else {
96
101
m_logger->log (" Shader compilation failed." , ILogger::ELL_ERROR);
102
+ return false ;
97
103
}
98
- return true ;
99
104
}
100
105
101
106
void workLoopBody () override {}
0 commit comments