Archived
1
Fork 0

Use the to_language parameter instead of choosing by platform

This commit is contained in:
redstrate 2020-08-15 20:35:46 -04:00
parent 6db47e272f
commit f50852abeb

View file

@ -97,7 +97,9 @@ std::optional<ShaderSource> ShaderCompiler::compile(const ShaderLanguage from_la
return std::nullopt;
}
#ifdef PLATFORM_MACOS
switch(to_language) {
case ShaderLanguage::MSL:
{
spirv_cross::CompilerMSL msl(std::move(spirv));
spirv_cross::CompilerMSL::Options opts;
@ -111,7 +113,10 @@ std::optional<ShaderSource> ShaderCompiler::compile(const ShaderLanguage from_la
msl.set_msl_options(opts);
return msl.compile();
#else
}
case ShaderLanguage::SPIRV:
return spirv;
#endif
default:
return {};
}
}