Lines Matching refs:program
77 // set produces the final program (including our re-emitted SkSL), and the backend's
220 std::unique_ptr<SkSL::Program> program;
231 program = compiler->convertProgram(kind, SkSL::String(sksl.c_str(), sksl.size()), settings);
233 if (!program) {
237 return MakeInternal(std::move(program), options, kind);
249 SkRuntimeEffect::Result SkRuntimeEffect::MakeFromDSL(std::unique_ptr<SkSL::Program> program,
253 // program's source. Populate it so that we can compute fHash, and serialize these effects.
254 program->fSource = std::make_unique<SkSL::String>(program->description());
255 return MakeInternal(std::move(program), options, kind);
258 SkRuntimeEffect::Result SkRuntimeEffect::MakeInternal(std::unique_ptr<SkSL::Program> program,
264 const SkSL::FunctionDefinition* main = SkSL::Program_GetFunction(*program, "main");
273 iter != mainParams.end() ? program->usage()->get(**iter)
290 if (!options.allowFragCoord && SkSL::Analysis::ReferencesFragCoords(*program)) {
299 SkASSERT(!SkSL::Analysis::ReferencesFragCoords(*program));
302 if (SkSL::Analysis::CallsSampleOutsideMain(*program)) {
313 // Go through program elements, pulling out information that we need
314 for (const SkSL::ProgramElement* elem : program->elements()) {
331 *program, var, sampleCoordsUsage.fWrite != 0, &elidedSampleCoords);
380 sk_sp<SkRuntimeEffect> effect(new SkRuntimeEffect(std::move(program),
408 SkRuntimeEffect::Result SkRuntimeEffect::MakeForColorFilter(std::unique_ptr<SkSL::Program> program,
410 auto result = MakeFromDSL(std::move(program), options, SkSL::ProgramKind::kRuntimeColorFilter);
415 SkRuntimeEffect::Result SkRuntimeEffect::MakeForShader(std::unique_ptr<SkSL::Program> program,
417 auto result = MakeFromDSL(std::move(program), options, SkSL::ProgramKind::kRuntimeShader);
422 SkRuntimeEffect::Result SkRuntimeEffect::MakeForBlender(std::unique_ptr<SkSL::Program> program,
424 auto result = MakeFromDSL(std::move(program), options, SkSL::ProgramKind::kRuntimeBlender);
430 std::unique_ptr<SkSL::Program> program) {
431 return MakeForColorFilter(std::move(program), Options{});
434 SkRuntimeEffect::Result SkRuntimeEffect::MakeForShader(std::unique_ptr<SkSL::Program> program) {
435 return MakeForShader(std::move(program), Options{});
438 SkRuntimeEffect::Result SkRuntimeEffect::MakeForBlender(std::unique_ptr<SkSL::Program> program) {
439 return MakeForBlender(std::move(program), Options{});
573 // Our per-effect program technique is only possible (and necessary) for color filters
592 // the program, these ids will be loads from the *first* arg ptr, the uniform data of the
619 // When we run this program later, we use the SampleCall to evaluate the correct child, and
622 // we are unable to use this per-effect program, and callers will need to fall back to another
686 // We'll use this program to filter one color at a time, don't bother with jit
693 SkFilterColorProgram::SkFilterColorProgram(skvm::Program program,
696 : fProgram(std::move(program))
704 // Our program defines sampling any child as returning a uniform color. Assemble a buffer
875 return as_SB(shader)->program(p, coord, coord, c, mats, /*localM=*/nullptr,
882 return as_CFB(colorFilter)->program(p, color, colorInfo, uniforms, alloc);
888 return as_BB(blender)->program(p, src, dst, colorInfo, uniforms, alloc);
905 // Get the generic program for filtering a single color
906 const SkFilterColorProgram* program = fEffect->getFilterColorProgram();
907 if (!program) {
908 // We were unable to build a cached (per-effect) program. Use the base-class fallback,
909 // which builds a program for the specific filter instance.
929 return program->eval(color, inputs->data(), evalChild);
1009 // CPU does the same thing (in SkShaderBase::program).
1039 return as_SB(shader)->program(p, device, coord, paint, mats, /*localM=*/nullptr,
1046 return as_CFB(colorFilter)->program(p, color, colorInfo, uniforms, alloc);
1052 return as_BB(blender)->program(p, src, dst, colorInfo, uniforms, alloc);
1149 return as_SB(shader)->program(p, coord, coord, src, mats, /*localM=*/nullptr,
1156 return as_CFB(colorFilter)->program(p, color, colorInfo, uniforms, alloc);
1162 return as_BB(blender)->program(p, src, dst, colorInfo, uniforms, alloc);
1170 // Emit the blend function as an SkVM program.