// TODO: Once Graphite has its own GPU-caps system, SK_GRAPHITE should get its own mode. // At the moment, it either mimics what GrShaderCaps reports, or it uses these hard-coded values // depending on the build. #ifdefined(SKSL_STANDALONE) || !defined(SK_GANESH)
std::unique_ptr<ShaderCaps> ShaderCapsFactory::MakeShaderCaps() {
std::unique_ptr<ShaderCaps> standalone = std::make_unique<ShaderCaps>();
standalone->fShaderDerivativeSupport = true;
standalone->fExplicitTextureLodSupport = true;
standalone->fFlatInterpolationSupport = true;
standalone->fNoPerspectiveInterpolationSupport = true;
standalone->fSampleMaskSupport = true;
standalone->fExternalTextureSupport = true; return standalone;
} #else
std::unique_ptr<ShaderCaps> ShaderCapsFactory::MakeShaderCaps() { return std::make_unique<ShaderCaps>();
} #endif// defined(SKSL_STANDALONE) || !defined(SK_GANESH)
bool type_to_sksltype(const Context& context, const Type& type, SkSLType* outType) { // If a new GrSL type is added, this function will need to be updated.
static_assert(kSkSLTypeCount == 41);
if (type.matches(*context.fTypes.fVoid )) { *outType = SkSLType::kVoid; returntrue; } if (type.matches(*context.fTypes.fBool )) { *outType = SkSLType::kBool; returntrue; } if (type.matches(*context.fTypes.fBool2 )) { *outType = SkSLType::kBool2; returntrue; } if (type.matches(*context.fTypes.fBool3 )) { *outType = SkSLType::kBool3; returntrue; } if (type.matches(*context.fTypes.fBool4 )) { *outType = SkSLType::kBool4; returntrue; } if (type.matches(*context.fTypes.fShort )) { *outType = SkSLType::kShort; returntrue; } if (type.matches(*context.fTypes.fShort2 )) { *outType = SkSLType::kShort2; returntrue; } if (type.matches(*context.fTypes.fShort3 )) { *outType = SkSLType::kShort3; returntrue; } if (type.matches(*context.fTypes.fShort4 )) { *outType = SkSLType::kShort4; returntrue; } if (type.matches(*context.fTypes.fUShort )) { *outType = SkSLType::kUShort; returntrue; } if (type.matches(*context.fTypes.fUShort2 )) { *outType = SkSLType::kUShort2; returntrue; } if (type.matches(*context.fTypes.fUShort3 )) { *outType = SkSLType::kUShort3; returntrue; } if (type.matches(*context.fTypes.fUShort4 )) { *outType = SkSLType::kUShort4; returntrue; } if (type.matches(*context.fTypes.fFloat )) { *outType = SkSLType::kFloat; returntrue; } if (type.matches(*context.fTypes.fFloat2 )) { *outType = SkSLType::kFloat2; returntrue; } if (type.matches(*context.fTypes.fFloat3 )) { *outType = SkSLType::kFloat3; returntrue; } if (type.matches(*context.fTypes.fFloat4 )) { *outType = SkSLType::kFloat4; returntrue; } if (type.matches(*context.fTypes.fFloat2x2)) { *outType = SkSLType::kFloat2x2; returntrue; } if (type.matches(*context.fTypes.fFloat3x3)) { *outType = SkSLType::kFloat3x3; returntrue; } if (type.matches(*context.fTypes.fFloat4x4)) { *outType = SkSLType::kFloat4x4; returntrue; } if (type.matches(*context.fTypes.fHalf )) { *outType = SkSLType::kHalf; returntrue; } if (type.matches(*context.fTypes.fHalf2 )) { *outType = SkSLType::kHalf2; returntrue; } if (type.matches(*context.fTypes.fHalf3 )) { *outType = SkSLType::kHalf3; returntrue; } if (type.matches(*context.fTypes.fHalf4 )) { *outType = SkSLType::kHalf4; returntrue; } if (type.matches(*context.fTypes.fHalf2x2 )) { *outType = SkSLType::kHalf2x2; returntrue; } if (type.matches(*context.fTypes.fHalf3x3 )) { *outType = SkSLType::kHalf3x3; returntrue; } if (type.matches(*context.fTypes.fHalf4x4 )) { *outType = SkSLType::kHalf4x4; returntrue; } if (type.matches(*context.fTypes.fInt )) { *outType = SkSLType::kInt; returntrue; } if (type.matches(*context.fTypes.fInt2 )) { *outType = SkSLType::kInt2; returntrue; } if (type.matches(*context.fTypes.fInt3 )) { *outType = SkSLType::kInt3; returntrue; } if (type.matches(*context.fTypes.fInt4 )) { *outType = SkSLType::kInt4; returntrue; } if (type.matches(*context.fTypes.fUInt )) { *outType = SkSLType::kUInt; returntrue; } if (type.matches(*context.fTypes.fUInt2 )) { *outType = SkSLType::kUInt2; returntrue; } if (type.matches(*context.fTypes.fUInt3 )) { *outType = SkSLType::kUInt3; returntrue; } if (type.matches(*context.fTypes.fUInt4 )) { *outType = SkSLType::kUInt4; returntrue; } returnfalse;
}
} // namespace SkSL
Messung V0.5
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.