2016-07-22 02:32:23 +00:00
|
|
|
#include "CModelShaders.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
|
|
|
|
std::experimental::optional<CModelShaders> CModelShaders::g_ModelShaders;
|
|
|
|
|
|
|
|
hecl::Runtime::ShaderCacheExtensions
|
|
|
|
CModelShaders::GetShaderExtensions(boo::IGraphicsDataFactory::Platform plat)
|
|
|
|
{
|
|
|
|
switch (plat)
|
|
|
|
{
|
2016-08-24 04:35:35 +00:00
|
|
|
case boo::IGraphicsDataFactory::Platform::OpenGL:
|
2016-07-22 02:32:23 +00:00
|
|
|
case boo::IGraphicsDataFactory::Platform::Vulkan:
|
|
|
|
return GetShaderExtensionsGLSL(plat);
|
|
|
|
#if _WIN32
|
|
|
|
case boo::IGraphicsDataFactory::Platform::D3D11:
|
|
|
|
case boo::IGraphicsDataFactory::Platform::D3D12:
|
|
|
|
return GetShaderExtensionsHLSL(plat);
|
|
|
|
#endif
|
|
|
|
#if BOO_HAS_METAL
|
|
|
|
case boo::IGraphicsDataFactory::Platform::Metal:
|
|
|
|
return GetShaderExtensionsMetal(plat);
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
return {boo::IGraphicsDataFactory::Platform::Null};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-31 20:52:04 +00:00
|
|
|
const hecl::Backend::TextureInfo CModelShaders::ThermalTextures[] =
|
|
|
|
{
|
|
|
|
{hecl::Backend::TexGenSrc::Normal, 7, 0, 7, true}
|
|
|
|
};
|
|
|
|
|
2016-07-22 02:32:23 +00:00
|
|
|
CModelShaders::CModelShaders(const hecl::Runtime::FileStoreManager& storeMgr,
|
|
|
|
boo::IGraphicsDataFactory* gfxFactory)
|
|
|
|
: m_shaderCache(storeMgr, gfxFactory, GetShaderExtensions(gfxFactory->platform())) {}
|
|
|
|
|
|
|
|
void CModelShaders::Initialize(const hecl::Runtime::FileStoreManager& storeMgr,
|
|
|
|
boo::IGraphicsDataFactory* gfxFactory)
|
|
|
|
{
|
|
|
|
g_ModelShaders.emplace(storeMgr, gfxFactory);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|