metaforce/Runtime/Particle/CElementGenShaders.hpp

85 lines
2.8 KiB
C++
Raw Normal View History

2016-02-15 04:00:26 +00:00
#ifndef __PSHAG_CELEMENTGENSHADERS_HPP__
#define __PSHAG_CELEMENTGENSHADERS_HPP__
2016-03-04 23:04:53 +00:00
#include "Graphics/CGraphics.hpp"
2016-02-15 04:00:26 +00:00
#include "boo/graphicsdev/GL.hpp"
#include "boo/graphicsdev/D3D.hpp"
#include "boo/graphicsdev/Metal.hpp"
2016-02-23 02:34:16 +00:00
#include "boo/graphicsdev/Vulkan.hpp"
2016-02-15 04:00:26 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
2016-02-15 04:00:26 +00:00
{
class CElementGen;
class CElementGenShaders
{
public:
struct IDataBindingFactory
{
2016-03-30 19:16:01 +00:00
virtual void BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx,
CElementGen& gen,
2016-02-15 04:00:26 +00:00
boo::IShaderPipeline* regPipeline,
boo::IShaderPipeline* redToAlphaPipeline)=0;
};
enum class EShaderClass
{
Tex,
IndTex,
NoTex
};
private:
static boo::IShaderPipeline* m_texZTestZWrite;
static boo::IShaderPipeline* m_texNoZTestZWrite;
static boo::IShaderPipeline* m_texZTestNoZWrite;
static boo::IShaderPipeline* m_texNoZTestNoZWrite;
static boo::IShaderPipeline* m_texAdditiveZTest;
static boo::IShaderPipeline* m_texAdditiveNoZTest;
static boo::IShaderPipeline* m_texRedToAlphaZTest;
static boo::IShaderPipeline* m_texRedToAlphaNoZTest;
static boo::IShaderPipeline* m_indTexZWrite;
static boo::IShaderPipeline* m_indTexNoZWrite;
static boo::IShaderPipeline* m_indTexAdditive;
static boo::IShaderPipeline* m_cindTexZWrite;
static boo::IShaderPipeline* m_cindTexNoZWrite;
static boo::IShaderPipeline* m_cindTexAdditive;
static boo::IShaderPipeline* m_noTexZTestZWrite;
static boo::IShaderPipeline* m_noTexNoZTestZWrite;
static boo::IShaderPipeline* m_noTexZTestNoZWrite;
static boo::IShaderPipeline* m_noTexNoZTestNoZWrite;
static boo::IShaderPipeline* m_noTexAdditiveZTest;
static boo::IShaderPipeline* m_noTexAdditiveNoZTest;
static boo::IVertexFormat* m_vtxFormatTex; /* No OpenGL */
static boo::IVertexFormat* m_vtxFormatIndTex; /* No OpenGL */
static boo::IVertexFormat* m_vtxFormatNoTex; /* No OpenGL */
static std::unique_ptr<IDataBindingFactory> m_bindFactory;
static boo::GraphicsDataToken m_gfxToken;
public:
2016-03-30 19:16:01 +00:00
static IDataBindingFactory* Initialize(boo::GLDataFactory::Context& ctx);
2016-02-15 04:00:26 +00:00
#if _WIN32
2016-03-30 19:16:01 +00:00
static IDataBindingFactory* Initialize(boo::ID3DDataFactory::Context& ctx);
2016-02-23 02:34:16 +00:00
#endif
#if BOO_HAS_METAL
2016-03-30 19:16:01 +00:00
static IDataBindingFactory* Initialize(boo::MetalDataFactory::Context& ctx);
2016-02-15 04:00:26 +00:00
#endif
2016-02-23 02:34:16 +00:00
#if BOO_HAS_VULKAN
2016-03-30 19:16:01 +00:00
static IDataBindingFactory* Initialize(boo::VulkanDataFactory::Context& ctx);
2016-02-23 02:34:16 +00:00
#endif
2016-02-15 04:00:26 +00:00
static void Initialize();
2016-02-16 19:42:24 +00:00
static void Shutdown();
2016-02-15 04:00:26 +00:00
static EShaderClass GetShaderClass(CElementGen& gen);
2016-03-30 19:16:01 +00:00
static void BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, CElementGen& gen);
2016-02-15 04:00:26 +00:00
};
}
#endif // __PSHAG_CELEMENTGENSHADERS_HPP__