42 for (
size_t index = 0; index < fields.
size(); ++index) {
55 std::string_view typeName,
57 std::string_view varName,
62 context.
fErrors->
error(
pos,
"interface blocks are not allowed in this kind of program");
67 if (rtAdjustIndex.has_value()) {
68 const Field& rtAdjustField = fields[*rtAdjustIndex];
126 if (variable->
name().empty()) {
128 for (
size_t i = 0;
i < fields.
size(); ++
i) {
130 context, std::make_unique<SkSL::FieldSymbol>(fields[
i].
fPosition, variable,
i));
137 return std::make_unique<SkSL::InterfaceBlock>(
pos, variable);
143 std::string(this->
typeName()) +
" {\n";
148 for (
const auto&
f : structType->
fields()) {
149 result +=
f.description() +
"\n";
const std::unique_ptr< Type > fFloat4
static constexpr const char RTADJUST_NAME[]
const BuiltinTypes & fTypes
SymbolTable * fSymbolTable
void error(Position position, std::string_view msg)
static std::unique_ptr< InterfaceBlock > Make(const Context &context, Position pos, Variable *variable)
~InterfaceBlock() override
std::string description() const override
static std::unique_ptr< InterfaceBlock > Convert(const Context &context, Position pos, const Modifiers &modifiers, std::string_view typeName, skia_private::TArray< Field > fields, std::string_view varName, int arraySize)
std::string_view instanceName() const
std::string_view typeName() const
std::string description() const
void addWithoutOwnership(const Context &context, Symbol *symbol)
const Type * addArrayDimension(const Context &context, const Type *type, int arraySize)
T * takeOwnershipOfSymbol(std::unique_ptr< T > symbol)
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 SkSpan< const Field > fields() const
bool matches(const Type &other) const
static std::unique_ptr< Type > MakeStructType(const Context &context, Position pos, std::string_view name, skia_private::TArray< Field > fields, bool interfaceBlock=false)
static void ErrorCheck(const Context &context, Position pos, Position modifiersPosition, const Layout &layout, ModifierFlags modifierFlags, const Type *type, const Type *baseType, Variable::Storage storage)
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 void detachDeadInterfaceBlock()
ModifierFlags modifierFlags() const
virtual const Layout & layout() const
constexpr size_t size() const
EMSCRIPTEN_KEEPALIVE void empty()
std::string void appendf(std::string *str, const char *fmt,...) SK_PRINTF_LIKE(2
static std::optional< int > find_rt_adjust_index(SkSpan< const Field > fields)
std::string description() const
SkSL::ModifierFlags fFlags
static bool IsVertex(ProgramKind kind)
static bool IsFragment(ProgramKind kind)
static bool IsCompute(ProgramKind kind)