summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/d3d/GpuProgramsD3D.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/d3d/GpuProgramsD3D.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/GfxDevice/d3d/GpuProgramsD3D.h')
-rw-r--r--Runtime/GfxDevice/d3d/GpuProgramsD3D.h40
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
+};