2015-11-18 23:56:45 +00:00
|
|
|
#ifndef HECLBACKEND_METAL_HPP
|
|
|
|
#define HECLBACKEND_METAL_HPP
|
2016-02-23 02:33:29 +00:00
|
|
|
#if BOO_HAS_METAL
|
2015-11-18 23:56:45 +00:00
|
|
|
|
|
|
|
namespace HECL
|
|
|
|
{
|
|
|
|
namespace Backend
|
|
|
|
{
|
|
|
|
|
|
|
|
struct Metal : ProgrammableCommon
|
|
|
|
{
|
|
|
|
void reset(const IR& ir, Diagnostics& diag);
|
|
|
|
std::string makeVert(unsigned col, unsigned uv, unsigned w,
|
|
|
|
unsigned skinSlots, unsigned texMtxs) const;
|
|
|
|
std::string makeFrag(const ShaderFunction& lighting=ShaderFunction()) const;
|
|
|
|
std::string makeFrag(const ShaderFunction& lighting,
|
|
|
|
const ShaderFunction& post) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string GenerateVertInStruct(unsigned col, unsigned uv, unsigned w) const;
|
|
|
|
std::string GenerateVertToFragStruct() const;
|
|
|
|
std::string GenerateVertUniformStruct(unsigned skinSlots, unsigned texMtxs) const;
|
|
|
|
|
|
|
|
std::string EmitVec3(const atVec4f& vec) const
|
|
|
|
{
|
|
|
|
return HECL::Format("float3(%g,%g,%g)", vec.vec[0], vec.vec[1], vec.vec[2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string EmitTexGenSource2(TexGenSrc src, int uvIdx) const;
|
|
|
|
std::string EmitTexGenSource4(TexGenSrc src, int uvIdx) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-23 02:33:29 +00:00
|
|
|
#endif // BOO_HAS_METAL
|
2015-11-18 23:56:45 +00:00
|
|
|
#endif // HECLBACKEND_METAL_HPP
|