From b972cec461f6c587edd8febbc6dad45bad65046d Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 31 Oct 2021 19:37:06 +0800 Subject: *shader command parser --- Runtime/Graphics/ShaderCompiler.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Runtime/Graphics/ShaderCompiler.h') diff --git a/Runtime/Graphics/ShaderCompiler.h b/Runtime/Graphics/ShaderCompiler.h index 56ddb45..891efb7 100644 --- a/Runtime/Graphics/ShaderCompiler.h +++ b/Runtime/Graphics/ShaderCompiler.h @@ -37,4 +37,19 @@ class GLSLCompiler public: static void Compile(std::string& src, std::string& vsh, std::string& fsh, RenderCommandGroup& cmd)/*throw GLSLCompileException*/; +private: + static std::string GetContent(std::string& src, const char* from, const char* to); + static std::string TrimContent(std::string& src, const char* from, const char* to); + static bool IsLabelActive(std::string& src, const char* label); + + static void ParseCmd(std::string& cmd, RenderCommandGroup& group); + static bool IsCommandActive(std::string& src, const char* label); + static bool FindCmdPos(std::string& line, int* start, int* end); + static bool IsLineCommentd(std::string& line); + static void CommandCull(std::string& params, RenderCommandGroup& group); + static void CommandBlend(std::string& params, RenderCommandGroup& group); + static void CommandDepthTest(std::string& params, RenderCommandGroup& group); + static void CommandDepthWrite(std::string& params, RenderCommandGroup& group); + static void GetParams(const char* cmdName, std::string& params, std::string* out, int n); + }; -- cgit v1.1-26-g67d0