Skip to content

Commit e0daf72

Browse files
committed
Fix CHLSLLoader.cpp
1 parent df5b1e3 commit e0daf72

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

src/nbl/asset/interchange/CHLSLLoader.cpp

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,24 @@ SAssetBundle CHLSLLoader::loadAsset(system::IFile* _file, const IAssetLoader::SA
2626

2727

2828
const auto filename = _file->getFileName();
29-
//! TODO: Actually invoke the GLSL compiler to decode our type from any `#pragma`s
3029
std::filesystem::path extension = filename.extension();
3130

32-
33-
core::unordered_map<std::string,IShader::E_SHADER_STAGE> typeFromExt = {
34-
{".vert",IShader::ESS_VERTEX},
35-
{".tesc",IShader::ESS_TESSELLATION_CONTROL},
36-
{".tese",IShader::ESS_TESSELLATION_EVALUATION},
37-
{".geom",IShader::ESS_GEOMETRY},
38-
{".frag",IShader::ESS_FRAGMENT},
39-
{".comp",IShader::ESS_COMPUTE}
40-
};
41-
auto found = typeFromExt.find(extension.string());
42-
if (found == typeFromExt.end())
43-
{
44-
_NBL_ALIGNED_FREE(source);
45-
return {};
46-
}
47-
48-
auto shader = core::make_smart_refctd_ptr<ICPUShader>(reinterpret_cast<char*>(source), found->second, IShader::E_CONTENT_TYPE::ECT_GLSL, filename.string());
31+
//core::unordered_map<std::string,IShader::E_SHADER_STAGE> typeFromExt = {
32+
// {".vert",IShader::ESS_VERTEX},
33+
// {".tesc",IShader::ESS_TESSELLATION_CONTROL},
34+
// {".tese",IShader::ESS_TESSELLATION_EVALUATION},
35+
// {".geom",IShader::ESS_GEOMETRY},
36+
// {".frag",IShader::ESS_FRAGMENT},
37+
// {".comp",IShader::ESS_COMPUTE}
38+
// };
39+
//auto found = typeFromExt.find(extension.string());
40+
//if (found == typeFromExt.end())
41+
//{
42+
// _NBL_ALIGNED_FREE(source);
43+
// return {};
44+
//}
45+
46+
auto shader = core::make_smart_refctd_ptr<ICPUShader>(reinterpret_cast<char*>(source), IShader::ESS_UNKNOWN, IShader::E_CONTENT_TYPE::ECT_HLSL, filename.string());
4947
_NBL_ALIGNED_FREE(source);
5048

5149
return SAssetBundle(nullptr,{ core::make_smart_refctd_ptr<ICPUSpecializedShader>(std::move(shader),ISpecializedShader::SInfo({},nullptr,"main")) });

0 commit comments

Comments
 (0)