From 0054311bf3b4f619a631e95d8aa1ea2d4bfd01c6 Mon Sep 17 00:00:00 2001 From: Ethan Nicholas Date: Tue, 31 Jul 2018 09:44:36 -0400 Subject: 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 Commit-Queue: Ethan Nicholas --- src/sksl/SkSLCompiler.h | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'src/sksl/SkSLCompiler.h') 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 convertProgram(Program::Kind kind, String text, const Program::Settings& settings); - bool toSPIRV(const Program& program, OutputStream& out); + bool optimize(Program& program); + + std::unique_ptr specialize(Program& program, + const std::unordered_map& 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* outFormatArgs); void error(int offset, String msg) override; -- cgit v1.2.3