39class BuiltinVariableScanner {
53 void addDeclaringElement(
const Symbol* symbol) {
59 this->addDeclaringElement(decl);
61 this->addDeclaringElement(block);
67 "%.*s", (
int)var.
name().size(), var.
name().data());
71 void addImplicitFragColorWrite(
SkSpan<
const std::unique_ptr<ProgramElement>> elements) {
72 for (
const std::unique_ptr<ProgramElement>& pe : elements) {
89 static std::string_view GlobalVarBuiltinName(
const ProgramElement& elem) {
93 static std::string_view InterfaceBlockName(
const ProgramElement& elem) {
97 void sortNewElements() {
101 if (a->kind() != b->kind()) {
102 return a->kind() < b->kind();
105 case ProgramElement::Kind::kGlobalVar:
107 GlobalVarBuiltinName(*a) != GlobalVarBuiltinName(*b));
108 return GlobalVarBuiltinName(*a) < GlobalVarBuiltinName(*b);
110 case ProgramElement::Kind::kInterfaceBlock:
111 SkASSERT(a == b || InterfaceBlockName(*a) != InterfaceBlockName(*b));
112 return InterfaceBlockName(*a) < InterfaceBlockName(*b);
131 BuiltinVariableScanner scanner(context,
symbols);
140 for (
const auto& [var,
counts] : program.
fUsage->fVariableCounts) {
141 if (var->isBuiltin()) {
142 scanner.addDeclaringElement(var);
144 switch (var->layout().fBuiltin) {
174 scanner.sortNewElements();
178 scanner.fNewElements.begin(),
179 scanner.fNewElements.end());
182 program.
fUsage->add(*element);
#define SkASSERTF(cond, fmt,...)
static std::vector< SkPDFIndirectReference > sort(const THashSet< SkPDFIndirectReference > &src)
constexpr int SK_CLOCKWISE_BUILTIN
constexpr int SK_LASTFRAGCOLOR_BUILTIN
constexpr int SK_SECONDARYFRAGCOLOR_BUILTIN
constexpr int SK_FRAGCOORD_BUILTIN
std::vector< const ProgramElement * > fNewElements
const SymbolTable & fSymbols
int find(T *array, int N, T item)
static constexpr const char FRAGCOLOR_NAME[]
const Type & returnType() const
const FunctionDeclaration & declaration() const
std::string_view name() const
bool matches(const Type &other) const
GlobalVarDeclaration * globalVarDeclaration() const
virtual InterfaceBlock * interfaceBlock() const
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 counts
skgpu::graphite::Transform Transform
ProgramSettings fSettings
static bool IsFragment(ProgramKind kind)
bool fOutputSecondaryColor
std::vector< std::unique_ptr< ProgramElement > > fOwnedElements
std::shared_ptr< Context > fContext
std::unique_ptr< ProgramUsage > fUsage
ProgramInterface fInterface
ProgramInterface Interface
std::unique_ptr< SymbolTable > fSymbols
std::vector< const ProgramElement * > fSharedElements
std::unique_ptr< ProgramConfig > fConfig