diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2018-07-31 09:44:36 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-31 15:18:03 +0000 |
commit | 0054311bf3b4f619a631e95d8aa1ea2d4bfd01c6 (patch) | |
tree | a3a48bece53f8a381c2a2e431db08f5055282e4f /src/sksl/SkSLCompiler.h | |
parent | ce3c7bbd0de68fda69903107461738b6afc8a3f4 (diff) |
Re-re-land "added GrSkSLFP and converted DitherEffect to use it"
This reverts commit 6c48e4d11ce80fa5cfef56e13b2d5847fe94a7cc.
Bug: skia:
Change-Id: I7ee78990fc30eec545d1856e59eb6e0573089426
Reviewed-on: https://skia-review.googlesource.com/144348
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/SkSLCompiler.h')
-rw-r--r-- | src/sksl/SkSLCompiler.h | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/sksl/SkSLCompiler.h b/src/sksl/SkSLCompiler.h index c840bd800f..f902962f19 100644 --- a/src/sksl/SkSLCompiler.h +++ b/src/sksl/SkSLCompiler.h @@ -26,6 +26,8 @@ #define SK_TEXTURESAMPLERS_BUILTIN 10006 #define SK_OUT_BUILTIN 10007 #define SK_LASTFRAGCOLOR_BUILTIN 10008 +#define SK_MAIN_X_BUILTIN 10009 +#define SK_MAIN_Y_BUILTIN 10010 #define SK_FRAGCOORD_BUILTIN 15 #define SK_CLOCKWISE_BUILTIN 17 #define SK_VERTEXID_BUILTIN 42 @@ -59,6 +61,11 @@ public: kPermitInvalidStaticTests_Flag = 1, }; + enum class FormatArg { + kInput, + kOutput + }; + Compiler(Flags flags = kNone_Flags); ~Compiler() override; @@ -66,21 +73,29 @@ public: std::unique_ptr<Program> convertProgram(Program::Kind kind, String text, const Program::Settings& settings); - bool toSPIRV(const Program& program, OutputStream& out); + bool optimize(Program& program); + + std::unique_ptr<Program> specialize(Program& program, + const std::unordered_map<SkSL::String, SkSL::Program::Settings::Value>& inputs); + + bool toSPIRV(Program& program, OutputStream& out); + + bool toSPIRV(Program& program, String* out); - bool toSPIRV(const Program& program, String* out); + bool toGLSL(Program& program, OutputStream& out); - bool toGLSL(const Program& program, OutputStream& out); + bool toGLSL(Program& program, String* out); - bool toGLSL(const Program& program, String* out); + bool toMetal(Program& program, OutputStream& out); - bool toMetal(const Program& program, OutputStream& out); + bool toMetal(Program& program, String* out); - bool toMetal(const Program& program, String* out); + bool toCPP(Program& program, String name, OutputStream& out); - bool toCPP(const Program& program, String name, OutputStream& out); + bool toH(Program& program, String name, OutputStream& out); - bool toH(const Program& program, String name, OutputStream& out); + bool toPipelineStage(const Program& program, String* out, + std::vector<FormatArg>* outFormatArgs); void error(int offset, String msg) override; |