2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 15:04:56 +00:00

Metal shader generation

This commit is contained in:
Jack Andersen
2015-11-18 13:56:45 -10:00
parent e5c4008cfb
commit daa446588b
9 changed files with 491 additions and 10 deletions

View File

@@ -6,13 +6,20 @@
#include <ctime>
#include "HECL/Backend/GLSL.hpp"
#if __APPLE__
#include "HECL/Backend/Metal.hpp"
#endif
namespace HECL
{
namespace Runtime
{
IShaderBackendFactory* _NewGLSLBackendFactory(boo::IGraphicsDataFactory* gfxFactory);
#if _WIN32
IShaderBackendFactory* _NewHLSLBackendFactory(boo::IGraphicsDataFactory* gfxFactory);
#elif __APPLE__
IShaderBackendFactory* _NewMetalBackendFactory(boo::IGraphicsDataFactory* gfxFactory);
#endif
static LogVisor::LogModule Log("ShaderCacheManager");
static uint64_t IDX_MAGIC = SBig(uint64_t(0xDEADFEEDC001D00D));
@@ -110,10 +117,16 @@ ShaderCacheManager::ShaderCacheManager(const FileStoreManager& storeMgr,
case boo::IGraphicsDataFactory::PlatformOGL:
m_factory.reset(_NewGLSLBackendFactory(gfxFactory));
break;
#if _WIN32
case boo::IGraphicsDataFactory::PlatformD3D11:
case boo::IGraphicsDataFactory::PlatformD3D12:
m_factory.reset(_NewHLSLBackendFactory(gfxFactory));
break;
#elif __APPLE__ && HECL_HAS_METAL
case boo::IGraphicsDataFactory::PlatformMetal:
m_factory.reset(_NewMetalBackendFactory(gfxFactory));
break;
#endif
default:
Log.report(LogVisor::FatalError, _S("unsupported backend %s"), gfxFactory->platformName());
}