96 void write(std::string_view
s);
98 void writeLine(std::string_view
s = std::string_view());
240#if defined(SK_DEBUG) || defined(SKSL_STANDALONE)
281 this->
write(std::string_view(&c, 1));
285 this->
write(identifier);
292 switch (
type.typeKind()) {
294 const Type& component =
type.componentType();
310 SK_ABORT(
"unsupported vector type");
317 const Type& component =
type.componentType();
323 SK_ABORT(
"unsupported matrix type");
326 if (
type.columns() !=
type.rows()) {
334 if (
type.isUnsizedArray()) {
350 return std::string(
type.name());
353 return std::string(
type.name());
359 this->
write(
"struct ");
363 for (
const auto&
f : type.
fields()) {
366 const Type& baseType =
f.fType->isArray() ?
f.fType->componentType() : *
f.fType;
370 if (
f.fType->isArray()) {
384 switch (expr.
kind()) {
385 case Expression::Kind::kBinary:
388 case Expression::Kind::kConstructorDiagonalMatrix:
392 case Expression::Kind::kConstructorArrayCast:
395 case Expression::Kind::kConstructorCompound:
398 case Expression::Kind::kConstructorArray:
399 case Expression::Kind::kConstructorMatrixResize:
400 case Expression::Kind::kConstructorSplat:
401 case Expression::Kind::kConstructorStruct:
404 case Expression::Kind::kConstructorScalarCast:
405 case Expression::Kind::kConstructorCompoundCast:
409 this->
write(
"false");
411 case Expression::Kind::kFieldAccess:
414 case Expression::Kind::kFunctionCall:
420 case Expression::Kind::kPrefix:
423 case Expression::Kind::kPostfix:
426 case Expression::Kind::kSetting:
429 case Expression::Kind::kSwizzle:
432 case Expression::Kind::kVariableReference:
435 case Expression::Kind::kTernary:
462 this->
write(
"((" + tmpVar1 +
" = ");
464 this->
write(
") < (" + tmpVar2 +
" = ");
466 this->
write(
") ? " + tmpVar1 +
" : " + tmpVar2 +
")");
470 this->
write(
"(1.0 / sqrt(");
476float _determinant2(mat2 m) {
477return m[0].x*m[1].y - m[0].y*m[1].x;
482float _determinant3(mat3 m) {
484 a00 = m[0].x, a01 = m[0].y, a02 = m[0].z,
485 a10 = m[1].x, a11 = m[1].y, a12 = m[1].z,
486 a20 = m[2].x, a21 = m[2].y, a22 = m[2].z,
487 b01 = a22*a11 - a12*a21,
488 b11 =-a22*a10 + a12*a20,
489 b21 = a21*a10 - a11*a20;
490return a00*b01 + a01*b11 + a02*b21;
495mat4 _determinant4(mat4 m) {
497 a00 = m[0].x, a01 = m[0].y, a02 = m[0].z, a03 = m[0].w,
498 a10 = m[1].x, a11 = m[1].y, a12 = m[1].z, a13 = m[1].w,
499 a20 = m[2].x, a21 = m[2].y, a22 = m[2].z, a23 = m[2].w,
500 a30 = m[3].x, a31 = m[3].y, a32 = m[3].z, a33 = m[3].w,
501 b00 = a00*a11 - a01*a10,
502 b01 = a00*a12 - a02*a10,
503 b02 = a00*a13 - a03*a10,
504 b03 = a01*a12 - a02*a11,
505 b04 = a01*a13 - a03*a11,
506 b05 = a02*a13 - a03*a12,
507 b06 = a20*a31 - a21*a30,
508 b07 = a20*a32 - a22*a30,
509 b08 = a20*a33 - a23*a30,
510 b09 = a21*a32 - a22*a31,
511 b10 = a21*a33 - a23*a31,
512 b11 = a22*a33 - a23*a32;
513return b00*b11 - b01*b10 + b02*b09 + b03*b08 - b04*b07 + b05*b06;
521 this->
write(
"_determinant2(");
528 this->
write(
"_determinant3(");
535 this->
write(
"_determinant4(");
541 SkDEBUGFAILF(
"no polyfill for determinant(%s)",
type.description().c_str());
542 this->
write(
"determinant(");
549mat2 _inverse2(mat2 m) {
550return mat2(m[1].y, -m[0].y, -m[1].x, m[0].x) / (m[0].x * m[1].y - m[0].y * m[1].x);
555mat3 _inverse3(mat3 m) {
557 a00 = m[0].x, a01 = m[0].y, a02 = m[0].z,
558 a10 = m[1].x, a11 = m[1].y, a12 = m[1].z,
559 a20 = m[2].x, a21 = m[2].y, a22 = m[2].z,
560 b01 = a22*a11 - a12*a21,
561 b11 =-a22*a10 + a12*a20,
562 b21 = a21*a10 - a11*a20,
563 det = a00*b01 + a01*b11 + a02*b21;
565 b01, (-a22*a01 + a02*a21), ( a12*a01 - a02*a11),
566 b11, ( a22*a00 - a02*a20), (-a12*a00 + a02*a10),
567 b21, (-a21*a00 + a01*a20), ( a11*a00 - a01*a10)) / det;
572mat4 _inverse4(mat4 m) {
574 a00 = m[0].x, a01 = m[0].y, a02 = m[0].z, a03 = m[0].w,
575 a10 = m[1].x, a11 = m[1].y, a12 = m[1].z, a13 = m[1].w,
576 a20 = m[2].x, a21 = m[2].y, a22 = m[2].z, a23 = m[2].w,
577 a30 = m[3].x, a31 = m[3].y, a32 = m[3].z, a33 = m[3].w,
578 b00 = a00*a11 - a01*a10,
579 b01 = a00*a12 - a02*a10,
580 b02 = a00*a13 - a03*a10,
581 b03 = a01*a12 - a02*a11,
582 b04 = a01*a13 - a03*a11,
583 b05 = a02*a13 - a03*a12,
584 b06 = a20*a31 - a21*a30,
585 b07 = a20*a32 - a22*a30,
586 b08 = a20*a33 - a23*a30,
587 b09 = a21*a32 - a22*a31,
588 b10 = a21*a33 - a23*a31,
589 b11 = a22*a33 - a23*a32,
590 det = b00*b11 - b01*b10 + b02*b09 + b03*b08 - b04*b07 + b05*b06;
592 a11*b11 - a12*b10 + a13*b09,
593 a02*b10 - a01*b11 - a03*b09,
594 a31*b05 - a32*b04 + a33*b03,
595 a22*b04 - a21*b05 - a23*b03,
596 a12*b08 - a10*b11 - a13*b07,
597 a00*b11 - a02*b08 + a03*b07,
598 a32*b02 - a30*b05 - a33*b01,
599 a20*b05 - a22*b02 + a23*b01,
600 a10*b10 - a11*b08 + a13*b06,
601 a01*b08 - a00*b10 - a03*b06,
602 a30*b04 - a31*b02 + a33*b00,
603 a21*b02 - a20*b04 - a23*b00,
604 a11*b07 - a10*b09 - a12*b06,
605 a00*b09 - a01*b07 + a02*b06,
606 a31*b01 - a30*b03 - a32*b00,
607 a20*b03 - a21*b01 + a22*b00) / det;
614 this->
write(
"_inverse2(");
621 this->
write(
"_inverse3(");
628 this->
write(
"_inverse4(");
635 this->
write(
"inverse(");
643 int c =
type.columns();
650 if (!*writtenThisTranspose) {
651 *writtenThisTranspose =
true;
656 transposed +
"(").c_str());
658 for (
int row = 0; row < r; ++row) {
659 for (
int column = 0; column < c; ++column) {
667 this->
write(name +
"(");
675 bool isTextureFunctionWithBias =
false;
676 bool nameWritten =
false;
677 const char* closingParen =
")";
679 case k_abs_IntrinsicKind: {
687 this->
write(
"_absemulation");
695 case k_atan_IntrinsicKind:
697 arguments.
size() == 2 &&
700 if (
p.getOperator().kind() == Operator::Kind::MINUS) {
701 this->
write(
"atan(");
703 this->
write(
", -1.0 * ");
710 case k_ldexp_IntrinsicKind:
712 arguments.
size() == 2 &&
715 if (
p.getOperator().kind() == Operator::Kind::MINUS) {
716 this->
write(
"ldexp(");
720 this->
write(
" * -1)");
725 case k_dFdy_IntrinsicKind:
735 case k_dFdx_IntrinsicKind:
736 case k_fwidth_IntrinsicKind:
743 case k_determinant_IntrinsicKind:
750 case k_fma_IntrinsicKind:
755 this->
write(
") * (");
757 this->
write(
") + (");
763 case k_fract_IntrinsicKind:
766 this->
write(
"(0.5 - sign(");
768 this->
write(
") * (0.5 - fract(abs(");
774 case k_inverse_IntrinsicKind:
781 case k_inversesqrt_IntrinsicKind:
788 case k_min_IntrinsicKind:
791 if (
is_abs(*arguments[0])) {
795 if (
is_abs(*arguments[1])) {
803 case k_pow_IntrinsicKind:
811 this->
write(
"exp2(");
813 this->
write(
" * log2(");
817 case k_saturate_IntrinsicKind:
819 this->
write(
"clamp(");
821 this->
write(
", 0.0, 1.0)");
823 case k_sample_IntrinsicKind: {
824 const char* dim =
"";
826 const Type& arg0Type = arguments[0]->type();
827 const Type& arg1Type = arguments[1]->type();
831 isTextureFunctionWithBias =
true;
842 isTextureFunctionWithBias =
true;
853 isTextureFunctionWithBias =
true;
863 isTextureFunctionWithBias =
true;
881 this->
write(
"texture");
891 case k_sampleGrad_IntrinsicKind: {
893 this->
write(
"textureGrad");
897 case k_sampleLod_IntrinsicKind: {
899 this->
write(
"textureLod");
903 case k_transpose_IntrinsicKind:
910 case k_loadFloatBuffer_IntrinsicKind: {
929 for (
const auto& arg : arguments) {
930 this->
write(separator());
933 if (
fProgram.
fConfig->fSettings.fSharpenTextures && isTextureFunctionWithBias) {
936 this->
write(closingParen);
949 this->
write(
"(1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) * ");
969 this->
write(
".xy, ");
977 this->
write(tempVec);
983 this->
write(tempVec);
984 this->
write(
".xy, ");
985 this->
write(tempVec);
986 this->
write(
".zw))");
998 const Expression& argument = *arguments.front();
1017 this->
write(separator());
1028 fFunctionHeader +=
" float sk_FragCoord_InvW = 1. / sk_FragCoord_Workaround.w;\n";
1031 "vec4(sk_FragCoord_Workaround.xyz * sk_FragCoord_InvW, sk_FragCoord_InvW);\n";
1033 fFunctionHeader +=
" sk_FragCoord_Resolved.xy = floor(sk_FragCoord_Resolved.xy) + "
1052 "gl_FragCoord.w);\n";
1082 " sk_Clockwise = !sk_Clockwise;\n"
1144 const Type& baseType =
f.base()->type();
1145 int builtin = baseType.
fields()[
f.fieldIndex()].fLayout.fBuiltin;
1166 SkASSERT(op.
kind() == Operator::Kind::EQEQ || op.
kind() == Operator::Kind::NEQ);
1177 this->
write(
"((" + tempMatrix1 +
" = ");
1179 this->
write(
"), (" + tempMatrix2 +
" = ");
1181 this->
write(
"), (" + tempMatrix1);
1183 this->
write(tempMatrix2 +
"))");
1192 op.
kind() == Operator::Kind::LOGICALOR)) {
1198 right.type().isMatrix() && op.
isEquality()) {
1204 if (precedence >= parentPrecedence) {
1212 if (needsPositionWorkaround) {
1213 this->
write(
"sk_FragCoord_Workaround = (");
1221 if (isAssignmentToSampleMask) {
1223 this->
write(
"int(");
1226 if (isAssignmentToSampleMask) {
1229 if (needsPositionWorkaround) {
1232 if (precedence >= parentPrecedence) {
1239 if (Precedence::kTernary >= parentPrecedence) {
1261 if (Precedence::kTernary >= parentPrecedence) {
1268 if (Precedence::kTernary >= parentPrecedence) {
1276 if (Precedence::kTernary >= parentPrecedence) {
1283 if (Precedence::kPrefix >= parentPrecedence) {
1288 if (Precedence::kPrefix >= parentPrecedence) {
1295 if (Precedence::kPostfix >= parentPrecedence) {
1300 if (Precedence::kPostfix >= parentPrecedence) {
1307 if (
type.isInteger()) {
1331 this->
write(
"float ");
1340 for (
size_t index = 0; index <
f.parameters().
size(); ++index) {
1341 const Variable* param =
f.parameters()[index];
1347 if (
f.isMain() && param ==
f.getMainCoordsParameter()) {
1350 this->
write(separator());
1356 std::vector<int> sizes;
1358 if (
type->isArray()) {
1359 sizes.push_back(
type->columns());
1365 if (!param->
name().empty()) {
1371 this->
write(
"_skAnonymousParam");
1374 for (
int s : sizes) {
1395 for (
const std::unique_ptr<Statement>& stmt :
f.body()->as<
Block>().
children()) {
1396 if (!stmt->isEmpty()) {
1425 bool globalContext) {
1430 this->
write(
"flat ");
1433 this->
write(
"noperspective ");
1437 this->
write(
"const ");
1440 this->
write(
"uniform ");
1443 this->
write(
"inout ");
1453 this->
write(
"varying ");
1455 this->
write(
"out ");
1460 this->
write(
"readonly ");
1463 this->
write(
"writeonly ");
1466 this->
write(
"buffer ");
1471 if (intf.
typeName() ==
"sk_PerVertex") {
1479 for (
const auto&
f : structType->
fields()) {
1512 return fProgram.
fConfig->fSettings.fForceHighPrecision ?
"highp " :
"mediump ";
1547 this->
write(
"inout ");
1549 this->
write(
"out ");
1552 this->
write(
"mediump ");
1572 this->
write(
"uniform ");
1611 case Statement::Kind::kBlock:
1614 case Statement::Kind::kExpression:
1617 case Statement::Kind::kReturn:
1620 case Statement::Kind::kVarDeclaration:
1623 case Statement::Kind::kIf:
1626 case Statement::Kind::kFor:
1629 case Statement::Kind::kDo:
1632 case Statement::Kind::kSwitch:
1635 case Statement::Kind::kBreak:
1636 this->
write(
"break;");
1639 this->
write(
"continue;");
1642 this->
write(
"discard;");
1656 bool isScope =
b.isScope() ||
b.isEmpty();
1661 for (
const std::unique_ptr<Statement>& stmt :
b.children()) {
1662 if (!stmt->isEmpty()) {
1674 this->
write(
"if (");
1679 this->
write(
" else ");
1686 if (!
f.initializer() &&
f.test() && !
f.next()) {
1687 this->
write(
"while (");
1694 this->
write(
"for (");
1703 Position(),
f.test()->clone(), Operator::Kind::LOGICALAND,
1723 this->
write(
" while (");
1746 this->
write(
"bool ");
1747 this->
write(tmpVar);
1751 this->
write(
"if (");
1752 this->
write(tmpVar);
1755 this->
write(
"if (!");
1764 this->
write(tmpVar);
1786 this->
write(
"int ");
1787 this->
write(valueVar);
1791 this->
write(fallthroughVar);
1793 this->
write(
"for (int ");
1794 this->
write(loopVar);
1795 this->
write(
" = 0; ");
1796 this->
write(loopVar);
1797 this->
write(
" < 1; ");
1798 this->
write(loopVar);
1802 bool firstCase =
true;
1803 for (
const std::unique_ptr<Statement>& stmt :
s.cases()) {
1806 this->
write(
"if ((");
1810 this->
write(fallthroughVar);
1811 this->
write(
" > 0) || (");
1813 this->
write(valueVar);
1814 this->
write(
" == ");
1827 this->
write(fallthroughVar);
1828 this->
write(
" = 1;");
1845 this->
write(
"switch (");
1861 bool foundEmptyCase =
false;
1863 for (
const std::unique_ptr<Statement>& stmt :
s.cases()) {
1868 this->
write(
"case ");
1873 foundEmptyCase =
true;
1875 foundEmptyCase =
false;
1882 if (foundEmptyCase) {
1895 this->
write(
"return");
1902 this->
write(
" 0.0");
1920 case ProgramElement::Kind::kGlobalVar:
1924 case ProgramElement::Kind::kInterfaceBlock:
1932 case ProgramElement::Kind::kFunctionPrototype:
1936 case ProgramElement::Kind::kModifiers: {
1942 case ProgramElement::Kind::kStructDefinition:
1947 SkDEBUGFAILF(
"unsupported program element %s\n",
e.description().c_str());
1956 useRTFlipUniform &=
~Program::Interface::kRTFlip_FragCoord;
2005 this->
write(
"highp ");
2007 this->
write(
"vec4 sk_FragCoord_Workaround;\n");
2011 this->
write(
"highp ");
2013 this->
write(
"vec4 sk_FragCoord_Workaround;\n");
2018 const char* precision =
2019 fProgram.
fConfig->fSettings.fForceHighPrecision ?
"highp" :
"mediump";
2041 program.
fContext->fErrors->setSource(std::string_view());
#define SK_ABORT(message,...)
#define SkDEBUGFAILF(fmt,...)
constexpr int SK_SAMPLEMASK_BUILTIN
constexpr int SK_CLOCKWISE_BUILTIN
constexpr int SK_VERTEXID_BUILTIN
constexpr int SK_FRAGCOLOR_BUILTIN
constexpr int SK_LASTFRAGCOLOR_BUILTIN
constexpr int SK_POSITION_BUILTIN
constexpr int SK_INSTANCEID_BUILTIN
constexpr int SK_SECONDARYFRAGCOLOR_BUILTIN
constexpr int SK_POINTSIZE_BUILTIN
constexpr int SK_FRAGCOORD_BUILTIN
constexpr int SK_SAMPLEMASKIN_BUILTIN
virtual SkSpan< std::unique_ptr< Expression > > argumentSpan()=0
std::unique_ptr< Expression > & left()
std::unique_ptr< Expression > & right()
Operator getOperator() const
const StatementArray & children() const
const std::unique_ptr< Type > fFloat2
const std::unique_ptr< Type > fFloatLiteral
const std::unique_ptr< Type > fHalf2x2
const std::unique_ptr< Type > fUShort
const std::unique_ptr< Type > fInt
const std::unique_ptr< Type > fFloat2x2
const std::unique_ptr< Type > fFloat4x4
const std::unique_ptr< Type > fShort
const std::unique_ptr< Type > fFloat4
const std::unique_ptr< Type > fHalf3x3
const std::unique_ptr< Type > fFloat3x3
const std::unique_ptr< Type > fSampler2DRect
const std::unique_ptr< Type > fSamplerExternalOES
const std::unique_ptr< Type > fUInt
const std::unique_ptr< Type > fBool
const std::unique_ptr< Type > fFloat
const std::unique_ptr< Type > fFloat3
const std::unique_ptr< Type > fHalf
const std::unique_ptr< Type > fHalf4x4
static constexpr float kSharpenTexturesBias
CodeGenerator(const Context *context, const ShaderCaps *caps, const Program *program, OutputStream *stream)
const BuiltinTypes & fTypes
std::unique_ptr< Expression > & test()
std::unique_ptr< Statement > & statement()
void error(Position position, std::string_view msg)
ExpressionArray clone() const
const std::unique_ptr< Expression > & expression() const
const Type & type() const
std::string description() const final
AnyConstructor & asAnyConstructor()
std::string_view name() const
std::unique_ptr< Expression > & base()
std::unique_ptr< Statement > & statement()
std::unique_ptr< Expression > & next()
std::unique_ptr< Expression > & test()
std::unique_ptr< Statement > & initializer()
ExpressionArray & arguments()
const FunctionDeclaration & function() const
std::string mangledName() const
IntrinsicKind intrinsicKind() const
const Type & returnType() const
const FunctionDeclaration & declaration() const
const FunctionDeclaration & declaration() const
void writePrefixExpression(const PrefixExpression &p, Precedence parentPrecedence)
void writeIntrinsicCall(const FunctionCall &c)
void writeFieldAccess(const FieldAccess &f)
void writeModifiers(const Layout &layout, ModifierFlags flags, bool globalContext)
void writeIndexExpression(const IndexExpression &expr)
void writeLayout(const Layout &layout)
void writeExpression(const Expression &expr, Precedence parentPrecedence)
void writeForStatement(const ForStatement &f)
void writeAnyConstructor(const AnyConstructor &c, Precedence parentPrecedence)
void writeFunctionPrototype(const FunctionPrototype &f)
bool fFoundExternalSamplerDecl
void writeType(const Type &type)
void writeStructDefinition(const StructDefinition &s)
void writeInverseSqrtHack(const Expression &x)
void writeIdentifier(std::string_view identifier)
void writeTernaryExpression(const TernaryExpression &t, Precedence parentPrecedence)
void writeShortCircuitWorkaroundExpression(const BinaryExpression &b, Precedence parentPrecedence)
void writeCastConstructor(const AnyConstructor &c, Precedence parentPrecedence)
void writeTypePrecision(const Type &type)
bool fWrittenAbsEmulation
void writeExpressionStatement(const ExpressionStatement &s)
const char * getTypePrecision(const Type &type)
void writeBlock(const Block &b)
StringStream fExtraFunctions
bool fFoundRectSamplerDecl
void writeReturnStatement(const ReturnStatement &r)
void writeInverseHack(const Expression &mat)
std::string fFunctionHeader
void writeBinaryExpression(const BinaryExpression &b, Precedence parentPrecedence)
bool generateCode() override
void writeConstructorDiagonalMatrix(const ConstructorDiagonalMatrix &c, Precedence parentPrecedence)
void writeProgramElement(const ProgramElement &e)
bool fSetupFragCoordWorkaround
void writeSwitchStatement(const SwitchStatement &s)
void writeFunctionCall(const FunctionCall &c)
void writeSwizzle(const Swizzle &swizzle)
void writeStatement(const Statement &s)
void writeFunction(const FunctionDefinition &f)
void writeTransposeHack(const Expression &mat)
void writeGlobalVarDeclaration(const GlobalVarDeclaration &e)
void writeInterfaceBlock(const InterfaceBlock &intf)
void writeMinAbsHack(Expression &absExpr, Expression &otherExpr)
bool fWrittenDeterminant3
const FunctionDeclaration * fCurrentFunction
bool fWrittenDeterminant2
void writeLiteral(const Literal &l)
void writeVariableReference(const VariableReference &ref)
bool usesPrecisionModifiers() const
void writeMatrixComparisonWorkaround(const BinaryExpression &x)
bool shouldRewriteVoidTypedFunctions(const FunctionDeclaration *func) const
void writeDoStatement(const DoStatement &d)
GLSLCodeGenerator(const Context *context, const ShaderCaps *caps, const Program *program, OutputStream *out)
void writeLine(std::string_view s=std::string_view())
bool fWrittenTranspose[3][3]
void writeConstructorCompound(const ConstructorCompound &c, Precedence parentPrecedence)
void writePostfixExpression(const PostfixExpression &p, Precedence parentPrecedence)
void writeIfStatement(const IfStatement &stmt)
void writeDeterminantHack(const Expression &mat)
void write(std::string_view s)
void writeVarInitializer(const Variable &var, const Expression &value)
bool fWrittenDeterminant4
std::string getTypeName(const Type &type)
void writeFunctionDeclaration(const FunctionDeclaration &f)
void writeExtension(std::string_view name, bool require=true)
void writeVarDeclaration(const VarDeclaration &var, bool global)
Position position() const
virtual std::string description() const =0
std::unique_ptr< Expression > & test()
std::unique_ptr< Statement > & ifTrue()
std::unique_ptr< Statement > & ifFalse()
std::unique_ptr< Expression > & base()
std::unique_ptr< Expression > & index()
std::string_view instanceName() const
std::string_view typeName() const
static std::unique_ptr< Literal > MakeBool(const Context &context, Position pos, bool value)
std::string description(OperatorPrecedence) const override
SKSL_INT intValue() const
const Layout & layout() const
ExpressionArray & arguments()
std::string_view tightOperatorName() const
OperatorPrecedence getBinaryPrecedence() const
const char * operatorName() const
bool isAssignment() const
virtual void write(const void *s, size_t size)=0
virtual void writeText(const char *s)=0
Operator getOperator() const
std::unique_ptr< Expression > & operand()
Operator getOperator() const
std::unique_ptr< Expression > & operand()
std::unique_ptr< Expression > & expression()
std::unique_ptr< Expression > toLiteral(const ShaderCaps &caps) const
std::unique_ptr< Expression > & argument()
void writeText(const char *s) override
const std::string & str() const
void write(const void *s, size_t size) override
std::unique_ptr< Statement > & statement()
std::unique_ptr< Expression > & value()
std::unique_ptr< Expression > & base()
const ComponentArray & components() const
static std::string MaskString(const ComponentArray &inComponents)
std::string_view name() const
const Type & type() const
std::unique_ptr< Expression > & ifTrue()
std::unique_ptr< Expression > & test()
std::unique_ptr< Expression > & ifFalse()
virtual bool isVector() const
virtual const Type & componentType() const
virtual SkSpan< const Field > fields() const
bool matches(const Type &other) const
virtual bool isMatrix() const
virtual const Type & resolve() const
virtual int columns() const
virtual const Type & scalarTypeForLiteral() const
const Type & toCompound(const Context &context, int columns, int rows) const
TypeKind typeKind() const
virtual SpvDim_ dimensions() const
const Type & baseType() const
std::unique_ptr< Expression > & value()
const Variable * variable() const
virtual std::string_view mangledName() const
ModifierFlags modifierFlags() const
virtual const Layout & layout() const
static SkString identifier(const FontFamilyDesc &family, const FontDesc &font)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
FlutterSemanticsFlag flags
Dart_NativeFunction function
bool ContainsRTAdjust(const Expression &expr)
bool IsTrivialExpression(const Expression &expr)
bool HasSideEffects(const Expression &expr)
std::string printf(const char *fmt,...) SK_PRINTF_LIKE(1
std::string void void auto Separator()
static constexpr char kInverse4[]
static constexpr char kDeterminant4[]
static constexpr char kDeterminant2[]
void write_stringstream(const StringStream &s, OutputStream &out)
static bool is_abs(Expression &expr)
static constexpr char kDeterminant3[]
static constexpr char kInverse3[]
static constexpr char kInverse2[]
bool ToGLSL(Program &program, const ShaderCaps *caps, OutputStream &out)
bool is_sk_position(const Expression &expr)
bool is_sk_samplemask(const Expression &expr)
DEF_SWITCHES_START aot vmservice shared library name
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
constexpr bool contains(std::string_view str, std::string_view needle)
static SkString to_string(int n)
static std::unique_ptr< Expression > LoadFloatBuffer(const Context &context, const SkSL::ShaderCaps &shaderCaps, Position position, std::unique_ptr< Expression > idx)
std::string paddedDescription() const
static bool IsVertex(ProgramKind kind)
static bool IsFragment(ProgramKind kind)
ElementsCollection elements() const
std::shared_ptr< Context > fContext
ProgramInterface fInterface
std::vector< const ProgramElement * > fSharedElements
std::unique_ptr< std::string > fSource
std::unique_ptr< ProgramConfig > fConfig
const char * secondExternalTextureExtensionString() const
bool fRewriteMatrixComparisons
bool fExternalTextureSupport
const char * shaderDerivativeExtensionString() const
bool fMustForceNegatedAtanParamToFloat
bool fDualSourceBlendingSupport
bool fEmulateAbsIntFunction
bool fCanUseVoidInSequenceExpressions
const char * fFBFetchColorName
const char * externalTextureExtensionString() const
bool fUnfoldShortCircuitAsTernary
bool fRemovePowWithConstantExponent
bool fRewriteDoWhileLoops
bool fRewriteSwitchStatements
const char * fVersionDeclString
bool fBuiltinDeterminantSupport
bool fAddAndTrueToLoopCondition
bool fMustForceNegatedLdexpParamToMultiply
bool mustDeclareFragmentShaderOutput() const
bool fCanUseFractForNegativeValues
bool fRemoveConstFromFunctionParameters
bool fNoDefaultPrecisionForExternalSamplers
bool fUsesPrecisionModifiers
bool fCanUseMinAndAbsTogether
SkSL::GLSLGeneration fGLSLGeneration
#define TRACE_EVENT0(category_group, name)