34 declaration->detachDeadVariable();
40 if (fInterfaceBlockElement) {
47 return declaration ? declaration->
value().get() :
nullptr;
51 if (!fDeclaringElement) {
62 if (!fDeclaringElement) {
73 SkASSERT(!fDeclaringElement ||
this == declaration->
var());
74 if (!fDeclaringElement) {
75 fDeclaringElement = declaration;
81 fDeclaringElement = global;
89 return fMangledName.empty() ? this->
name() : fMangledName;
99 std::string_view
name,
107 "out location=0, index=0 is reserved for sk_FragColor");
115 context.
fErrors->
error(
pos,
"pipeline inputs not permitted in compute shaders");
117 context.
fErrors->
error(
pos,
"pipeline outputs not permitted in compute shaders");
121 if (
storage == Variable::Storage::kParameter) {
150 std::string_view
name,
151 std::string mangledName,
160 return std::make_unique<ExtendedVariable>(
pos,
170 return std::make_unique<Variable>(
pos,
182 std::string_view baseName,
185 std::unique_ptr<Expression> initialValue) {
190 SkDEBUGFAIL(
"found a $literal type in MakeScratchVariable");
195 const std::string*
name =
217 result.fVarSymbol = symbolTable->
add(context, std::move(var));
#define SkDEBUGFAIL(message)
static constexpr const char FRAGCOLOR_NAME[]
SymbolTable * fSymbolTable
void error(Position position, std::string_view msg)
~ExtendedVariable() override
std::string_view mangledName() const override
VarDeclaration & varDeclaration()
void detachDeadVariable()
std::string uniqueName(std::string_view baseName, SymbolTable *symbolTable)
const std::string * takeOwnershipOfString(std::string n)
T * add(const Context &context, std::unique_ptr< T > symbol)
std::string_view name() const
const Type & type() const
virtual bool isArray() const
virtual const Type & componentType() const
virtual bool isInterfaceBlock() const
virtual bool isLiteral() const
virtual int columns() const
virtual const Type & scalarTypeForLiteral() const
virtual bool isUnsizedArray() const
std::unique_ptr< Expression > & value()
static std::unique_ptr< VarDeclaration > Make(const Context &context, Variable *var, const Type *baseType, int arraySize, std::unique_ptr< Expression > value)
void setVarDeclaration(VarDeclaration *declaration)
virtual std::string_view mangledName() const
static std::unique_ptr< Variable > Make(Position pos, Position modifiersPosition, const Layout &layout, ModifierFlags flags, const Type *type, std::string_view name, std::string mangledName, bool builtin, Storage storage)
void setGlobalVarDeclaration(GlobalVarDeclaration *global)
GlobalVarDeclaration * globalVarDeclaration() const
Position modifiersPosition() const
const Expression * initialValue() const
static ScratchVariable MakeScratchVariable(const Context &context, Mangler &mangler, std::string_view baseName, const Type *type, SymbolTable *symbolTable, std::unique_ptr< Expression > initialValue)
VarDeclaration * varDeclaration() const
static std::unique_ptr< Variable > Convert(const Context &context, Position pos, Position modifiersPos, const Layout &layout, ModifierFlags flags, const Type *type, Position namePos, std::string_view name, Storage storage)
virtual const Layout & layout() const
FlutterSemanticsFlag flags
static constexpr Layout kDefaultLayout
IntrinsicKind FindIntrinsicKind(std::string_view functionName)
DEF_SWITCHES_START aot vmservice shared library name
constexpr bool starts_with(std::string_view str, std::string_view prefix)
static bool IsFragment(ProgramKind kind)
static bool IsCompute(ProgramKind kind)