23 const char* backendLabel,
24 const std::string& sksl,
33 const std::string& src = sksl;
36 std::unique_ptr<SkSL::Program> program =
compiler.convertProgram(programKind, src, settings);
37 if (!program || !(*toBackend)(*program, caps, output)) {
44#if defined(SK_PRINT_SKSL_SHADERS)
45 const bool kPrintSkSL =
true;
47 const bool kPrintSkSL =
false;
49 const bool kSkSLPostCompilation =
false;
50#if defined(SK_PRINT_NATIVE_SHADERS)
51 const bool printBackendSL = (backendLabel !=
nullptr);
53 const bool printBackendSL =
false;
56 if (kPrintSkSL || kSkSLPostCompilation || printBackendSL) {
62 if (kSkSLPostCompilation) {
63 SkDebugf(
"SkSL (post-compilation):\n");
73 *outInterface = program->fInterface;
bool SkSLToBackend(const SkSL::ShaderCaps *caps, bool(*toBackend)(SkSL::Program &, const SkSL::ShaderCaps *, std::string *), const char *backendLabel, const std::string &sksl, SkSL::ProgramKind programKind, const SkSL::ProgramSettings &settings, std::string *output, SkSL::ProgramInterface *outInterface, ShaderErrorHandler *errorHandler)