Skip to content

Commit 6e9e4f9

Browse files
committed
post merge fix, default entry point
1 parent 393cd48 commit 6e9e4f9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/nbl/asset/utils/CHLSLCompiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ core::smart_refctd_ptr<ICPUShader> CHLSLCompiler::compileToSPIRV(const char* cod
440440
hlslOptions
441441
);
442442

443-
if (arg_storage)
444-
delete[] arg_storage;
443+
if (argsArray)
444+
delete[] argsArray;
445445

446446
if (!compileResult.objectBlob)
447447
{

tools/nsc/main.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@ class ShaderCompiler final : public system::IApplicationFramework
129129
m_logger->log("nsc.exe was compiled with builtin resources disabled. Force enabling -no-nbl-builtins.", ILogger::ELL_WARNING);
130130
}
131131
#endif
132-
132+
if (std::find(m_arguments.begin(), m_arguments.end(), "-E") == m_arguments.end())
133+
{
134+
//Insert '-E main' into arguments if no entry point is specified
135+
m_arguments.push_back("-E");
136+
m_arguments.push_back("main");
137+
}
133138
auto shader = open_shader_file(file_to_compile);
134139
if (shader->getContentType() != IShader::E_CONTENT_TYPE::ECT_HLSL)
135140
{

0 commit comments

Comments
 (0)