summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/opengl/GpuProgramsGL.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/opengl/GpuProgramsGL.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/GfxDevice/opengl/GpuProgramsGL.h')
-rw-r--r--Runtime/GfxDevice/opengl/GpuProgramsGL.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/opengl/GpuProgramsGL.h b/Runtime/GfxDevice/opengl/GpuProgramsGL.h
new file mode 100644
index 0000000..f9649dd
--- /dev/null
+++ b/Runtime/GfxDevice/opengl/GpuProgramsGL.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "Runtime/GfxDevice/GpuProgram.h"
+#include "Runtime/GfxDevice/ChannelAssigns.h"
+
+class ShaderErrors;
+
+class GlslGpuProgram : public GpuProgramGL {
+public:
+ GlslGpuProgram( const std::string& source, CreateGpuProgramOutput& output );
+ virtual ~GlslGpuProgram();
+
+ virtual void ApplyGpuProgram (const GpuProgramParameters& params, const UInt8* buffer);
+
+ GLShaderID GetGLProgram (FogMode fog, GpuProgramParameters& outParams);
+
+private:
+ bool Create( const std::string& source, ShaderErrors& outErrors );
+ static void FillParams (GLShaderID programID, GpuProgramParameters& params, PropertyNamesSet* outNames);
+ void FillChannels (ChannelAssigns& channels);
+
+private:
+ GLShaderID m_GLSLVertexShader[kFogModeCount];
+ GLShaderID m_GLSLFragmentShader[kFogModeCount];
+ int m_FogColorIndex[kFogModeCount];
+ int m_FogParamsIndex[kFogModeCount];
+ bool m_FogFailed[kFogModeCount];
+};