diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/d3d/GpuProgramsD3D.h |
Diffstat (limited to 'Runtime/GfxDevice/d3d/GpuProgramsD3D.h')
-rw-r--r-- | Runtime/GfxDevice/d3d/GpuProgramsD3D.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/d3d/GpuProgramsD3D.h b/Runtime/GfxDevice/d3d/GpuProgramsD3D.h new file mode 100644 index 0000000..6b21fa9 --- /dev/null +++ b/Runtime/GfxDevice/d3d/GpuProgramsD3D.h @@ -0,0 +1,40 @@ +#pragma once + +#include "D3D9Includes.h" +#include "Runtime/GfxDevice/GpuProgram.h" + + +class D3D9VertexShader : public GpuProgram { +public: + D3D9VertexShader( const std::string& source ); + virtual ~D3D9VertexShader(); + + virtual void ApplyGpuProgram (const GpuProgramParameters& params, const UInt8* buffer); + IDirect3DVertexShader9* GetShader(FogMode fog, bool& outResetToNoFog); + IDirect3DVertexShader9* GetShaderAtFogIndex(FogMode fog) { return m_Shaders[fog]; } + +private: + bool Create( const std::string& source ); + + std::string m_SourceForFog; // original source, used for fog patching if needed + IDirect3DVertexShader9* m_Shaders[kFogModeCount]; + unsigned m_FogFailed; // bit per fog mode +}; + +class D3D9PixelShader : public GpuProgram { +public: + D3D9PixelShader( const std::string& source ); + virtual ~D3D9PixelShader(); + + virtual void ApplyGpuProgram (const GpuProgramParameters& params, const UInt8* buffer); + IDirect3DPixelShader9* GetShader(FogMode fog, const GpuProgramParameters& params); + IDirect3DPixelShader9* GetShaderAtFogIndex(FogMode fog) { return m_Shaders[fog]; } + +private: + bool Create( const std::string& source ); + + std::string m_SourceForFog; // original source, used for fog patching if needed + IDirect3DPixelShader9* m_Shaders[kFogModeCount]; + int m_FogRegisters[kFogModeCount]; + unsigned m_FogFailed; // bit per fog mode +}; |