/* modifiers type IDENTIFIER (LBRACKET INT_LITERAL RBRACKET)? */
std::unique_ptr<ASTParameter> Parser::parameter() {
- Modifiers modifiers = this->modifiersWithDefaults(Modifiers::kIn_Flag);
+ Modifiers modifiers = this->modifiersWithDefaults(0);
std::unique_ptr<ASTType> type = this->type();
if (!type) {
return nullptr;
SpvStorageClass_ get_storage_class(const Expression& expr) {
switch (expr.fKind) {
- case Expression::kVariableReference_Kind:
- return get_storage_class(((VariableReference&) expr).fVariable.fModifiers);
+ case Expression::kVariableReference_Kind: {
+ const Variable& var = ((VariableReference&) expr).fVariable;
+ if (var.fStorage != Variable::kGlobal_Storage) {
+ return SpvStorageClassFunction;
+ }
+ return get_storage_class(var.fModifiers);
+ }
case Expression::kFieldAccess_Kind:
return get_storage_class(*((FieldAccess&) expr).fBase);
case Expression::kIndex_Kind:
*SkSL::ShaderCapsFactory::Default(),
"#version 400\n"
"out vec4 sk_FragColor;\n"
- "float foo(in float v[2]) {\n"
+ "float foo(float v[2]) {\n"
" return v[0] * v[1];\n"
"}\n"
"void bar(inout float x) {\n"