summaryrefslogtreecommitdiff
path: root/Runtime/Graphics
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Graphics')
-rw-r--r--Runtime/Graphics/Shader.cpp3
-rw-r--r--Runtime/Graphics/ShaderCompiler.cpp5
-rw-r--r--Runtime/Graphics/ShaderCompiler.h3
3 files changed, 7 insertions, 4 deletions
diff --git a/Runtime/Graphics/Shader.cpp b/Runtime/Graphics/Shader.cpp
index 4c41d6b..67bbe01 100644
--- a/Runtime/Graphics/Shader.cpp
+++ b/Runtime/Graphics/Shader.cpp
@@ -51,9 +51,10 @@ Shader::Shader(LuaBind::VM*vm, std::string& glslShader)
// stl的string会在大小超过阈值的情况下在栈里分配,并用RAII保证释放
std::string vsh ;
std::string fsh ;
+ RenderCommandGroup cmd;
try
{
- GLSLCompiler::Compile(glslShader, vsh, fsh);
+ GLSLCompiler::Compile(glslShader, vsh, fsh, cmd);
}
catch (GLSLCompileException& e)
{
diff --git a/Runtime/Graphics/ShaderCompiler.cpp b/Runtime/Graphics/ShaderCompiler.cpp
index ba69313..809c375 100644
--- a/Runtime/Graphics/ShaderCompiler.cpp
+++ b/Runtime/Graphics/ShaderCompiler.cpp
@@ -7,11 +7,12 @@ const char* VSH_END = "VSH_END";
const char* FSH_BEGIN = "FSH_BEGIN";
const char* FSH_END = "FSH_END";
-// GLSL分为三部分
+// GLSL分为四部分
+// * CMD_BEGIN 和 CMD_END 之间的命令
// * VERTEX_SHADER_BEGIN 和 VERTEX_SHADER_END之间的顶点着色器
// * FRAGMENT_SHADER_BEGIN 和 FRAGMENT_SHADER_END之间的片段着色器
// * 两者之外的公共部分
-void GLSLCompiler::Compile(std::string& src, std::string& vsh, std::string& fsh)/*throw GLSLCompileException*/
+void GLSLCompiler::Compile(std::string& src, std::string& vsh, std::string& fsh, RenderCommandGroup& cmd)/*throw GLSLCompileException*/
{
int vsh_begin = src.find(VSH_BEGIN);
if (vsh_begin == string::npos)
diff --git a/Runtime/Graphics/ShaderCompiler.h b/Runtime/Graphics/ShaderCompiler.h
index 4e276c1..56ddb45 100644
--- a/Runtime/Graphics/ShaderCompiler.h
+++ b/Runtime/Graphics/ShaderCompiler.h
@@ -4,6 +4,7 @@
#include <string>
#include "Runtime/Threading/Mutex.h"
#include "Runtime/Threading/Job.h"
+#include "Runtime/Graphics/RenderCommands.h"
// 编译GLSL(GameLab Shading Language)
@@ -34,6 +35,6 @@ public:
class GLSLCompiler
{
public:
- static void Compile(std::string& src, std::string& vsh, std::string& fsh)/*throw GLSLCompileException*/;
+ static void Compile(std::string& src, std::string& vsh, std::string& fsh, RenderCommandGroup& cmd)/*throw GLSLCompileException*/;
};