Skip to content

Commit 68c113a

Browse files
committed
minor changes
1 parent 049f9e1 commit 68c113a

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

include/nbl/asset/utils/CHLSLCompiler.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ class NBL_API2 CHLSLCompiler final : public IShaderCompiler
5757
// when Nabla is used as a lib
5858
nbl::asset::hlsl::impl::DXC* m_dxcCompilerTypes;
5959

60-
IShaderCompiler::CIncludeFinder* m_defaultIncludeFinder;
61-
6260
static CHLSLCompiler::SOptions option_cast(const IShaderCompiler::SCompilerOptions& options)
6361
{
6462
CHLSLCompiler::SOptions ret = {};

src/nbl/asset/utils/CHLSLCompiler.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ std::string CHLSLCompiler::preprocessShader(std::string&& code, IShader::E_SHADE
355355

356356
core::smart_refctd_ptr<ICPUShader> CHLSLCompiler::compileToSPIRV(const char* code, const IShaderCompiler::SCompilerOptions& options) const
357357
{
358-
m_defaultIncludeFinder->addSearchPath("nbl/builtin/hlsl/jit", core::make_smart_refctd_ptr<CJITIncludeLoader>());
359-
360358
auto hlslOptions = option_cast(options);
361359

362360
if (!code)

src/nbl/asset/utils/CJITIncludeLoader.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ std::optional<std::string> CJITIncludeLoader::getInclude(const system::path& sea
1111
{
1212
system::path path = searchPath / includeName;
1313

14-
if (searchPath == "nbl/builtin/hlsl/jit")
14+
assert(searchPath == "nbl/builtin/hlsl/jit");
15+
16+
// Look up the content in m_includes map
17+
auto it = m_includes.find(path);
18+
if (it != m_includes.end())
1519
{
16-
// Look up the content in m_includes map
17-
auto it = m_includes.find(path);
18-
if (it != m_includes.end())
19-
{
20-
// Return the content of the specified include file
21-
return it->second;
22-
}
23-
return std::nullopt;
20+
// Return the content of the specified include file
21+
return it->second;
2422
}
23+
2524
return std::nullopt;
2625
}
2726

0 commit comments

Comments
 (0)