Skip to content

Commit b7de778

Browse files
committed
CCompilerSet doesn't need to cast anymore
1 parent dcdd405 commit b7de778

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/nbl/asset/utils/CCompilerSet.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,13 @@ core::smart_refctd_ptr<const ICPUShader> CCompilerSet::compileToSPIRV(const ICPU
1616
case IShader::E_CONTENT_TYPE::ECT_HLSL:
1717
{
1818
const char* code = reinterpret_cast<const char*>(shader->getContent()->getPointer());
19-
if (options.getCodeContentType() == IShader::E_CONTENT_TYPE::ECT_HLSL)
20-
{
21-
outSpirvShader = m_HLSLCompiler->compileToSPIRV(code, static_cast<const CHLSLCompiler::SOptions&>(options));
22-
}
23-
else
24-
{
25-
CHLSLCompiler::SOptions hlslCompilerOptions = {};
26-
hlslCompilerOptions.setCommonData(options);
27-
outSpirvShader = m_HLSLCompiler->compileToSPIRV(code, hlslCompilerOptions);
28-
}
19+
outSpirvShader = m_HLSLCompiler->compileToSPIRV(code, options);
2920
}
3021
break;
3122
case IShader::E_CONTENT_TYPE::ECT_GLSL:
3223
{
3324
const char* code = reinterpret_cast<const char*>(shader->getContent()->getPointer());
34-
if (options.getCodeContentType() == IShader::E_CONTENT_TYPE::ECT_GLSL)
35-
{
36-
outSpirvShader = m_GLSLCompiler->compileToSPIRV(code, static_cast<const CGLSLCompiler::SOptions&>(options));
37-
}
38-
else
39-
{
40-
CGLSLCompiler::SOptions glslCompilerOptions = {};
41-
glslCompilerOptions.setCommonData(options);
42-
outSpirvShader = m_GLSLCompiler->compileToSPIRV(code, glslCompilerOptions);
43-
}
25+
outSpirvShader = m_GLSLCompiler->compileToSPIRV(code, options);
4426
}
4527
break;
4628
case IShader::E_CONTENT_TYPE::ECT_SPIRV:

0 commit comments

Comments
 (0)