Lines Matching defs:main
721 // void main() {
3361 const FunctionDeclaration& main) {
3363 // void _entrypoint() { sk_FragColor = main(); }
3365 // Fish a symbol table out of main().
3366 std::shared_ptr<SymbolTable> symbolTable = get_top_level_symbol_table(main);
3374 // Synthesize a call to the `main()` function.
3375 if (main.returnType() != skFragColorRef->type()) {
3376 fContext.fErrors->error(main.fLine, "SPIR-V does not support returning '" +
3377 main.returnType().description() + "' from main()");
3381 if (main.parameters().size() == 1) {
3382 if (main.parameters()[0]->type() != *fContext.fTypes.fFloat2) {
3383 fContext.fErrors->error(main.fLine,
3385 main.parameters()[0]->type().description() + "' to main()");
3390 auto callMainFn = std::make_unique<FunctionCall>(/*line=*/-1, &main.returnType(), &main,
3393 // Synthesize `skFragColor = main()` as a BinaryExpression.
3399 &main.returnType()));
3539 const FunctionDeclaration* main = nullptr;
3546 main = &funcDecl;
3550 // Make sure we have a main() function.
3551 if (!main) {
3552 fContext.fErrors->error(/*line=*/-1, "program does not contain a main() function");
3578 this->writeUniformBuffer(get_top_level_symbol_table(*main));
3580 // If main() returns a half4, synthesize a tiny entrypoint function which invokes the real
3581 // main() and stores the result into sk_FragColor.
3583 if (main->returnType() == *fContext.fTypes.fHalf4) {
3584 adapter = this->writeEntrypointAdapter(*main);
3588 main = adapter.entrypointDecl.get();
3609 this->writeOpCode(SpvOpEntryPoint, (SpvId) (3 + (main->name().length() + 4) / 4) +
3621 SpvId entryPoint = fFunctionMap[main];
3623 this->writeString(main->name(), out);
3629 fFunctionMap[main],