metaforce/Runtime/Graphics/Shaders/CModelShaders.cpp

46 lines
1.3 KiB
C++
Raw Normal View History

#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:
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}
};
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);
}
}