Skip to content

Commit 6d4836b

Browse files
committed
move function to cpp
1 parent 5dda9b4 commit 6d4836b

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

include/nbl/asset/utils/IShaderCompiler.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -264,18 +264,7 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
264264

265265
virtual void insertIntoStart(std::string& code, std::ostringstream&& ins) const = 0;
266266

267-
void insertExtraDefines(std::string& code, const core::SRange<const char* const>& defines) const
268-
{
269-
if (defines.empty())
270-
return;
271-
272-
std::ostringstream insertion;
273-
for (auto def : defines)
274-
{
275-
insertion << "#define " << def << "\n";
276-
}
277-
insertIntoStart(code, std::move(insertion));
278-
}
267+
void insertExtraDefines(std::string& code, const core::SRange<const char* const>& defines) const;
279268

280269
core::smart_refctd_ptr<system::ISystem> m_system;
281270
private:

src/nbl/asset/utils/IShaderCompiler.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,16 @@ std::string IShaderCompiler::CIncludeFinder::tryIncludeGenerators(const std::str
207207

208208
return "";
209209
}
210+
211+
void IShaderCompiler::insertExtraDefines(std::string& code, const core::SRange<const char* const>& defines) const
212+
{
213+
if (defines.empty())
214+
return;
215+
216+
std::ostringstream insertion;
217+
for (auto i = 0u; i < defines.size(); ++i)
218+
{
219+
insertion << "#define " << defines[i] << "\r\n";
220+
}
221+
insertIntoStart(code, std::move(insertion));
222+
}

0 commit comments

Comments
 (0)