Lines Matching defs:context

39 void VarDeclaration::ErrorCheck(const Context& context, int line, const Modifiers& modifiers,
41 if (*baseType == *context.fTypes.fInvalid) {
42 context.fErrors->error(line, "invalid type");
45 if (context.fConfig->strictES2Mode() && baseType->isArray()) {
46 context.fErrors->error(line, "array size must appear after variable name");
50 context.fErrors->error(line,
54 context.fErrors->error(line, "'in' variables may not have matrix type");
57 context.fErrors->error(line, "'in uniform' variables not permitted");
59 if (ProgramConfig::IsRuntimeEffect(context.fConfig->fKind)) {
61 context.fErrors->error(line, "'in' variables not permitted in runtime effects");
65 context.fErrors->error(line,
69 if (!ProgramConfig::IsRuntimeEffect(context.fConfig->fKind)) {
70 context.fErrors->error(line, "'srgb_unpremul' is only permitted in runtime effects");
73 context.fErrors->error(line,
82 context.fErrors->error(line, "'srgb_unpremul' is only permitted on half3, half4, "
93 modifiers.checkPermitted(context, line, permitted, /*permittedLayoutFlags=*/~0);
96 bool VarDeclaration::ErrorCheckAndCoerce(const Context& context, const Variable& var,
102 ErrorCheck(context, var.fLine, var.modifiers(), baseType, var.storage());
105 context.fErrors->error(value->fLine,
110 context.fErrors->error(value->fLine,
115 context.fErrors->error(value->fLine,
120 context.fErrors->error(value->fLine,
124 value = var.type().coerceExpression(std::move(value), context);
131 context.fErrors->error(var.fLine, "'const' variables must be initialized");
135 context.fErrors->error(value->fLine,
142 context.fErrors->error(var.fLine, "opaque type '" + var.type().name() +
149 context.fErrors->error(value->fLine,
157 std::unique_ptr<Statement> VarDeclaration::Convert(const Context& context,
159 if (!ErrorCheckAndCoerce(context, *var, value)) {
168 std::unique_ptr<Statement> varDecl = VarDeclaration::Make(context, var.get(), baseType,
186 context.fErrors->error(var->fLine, "duplicate definition of 'sk_RTAdjust'");
189 if (var->type() != *context.fTypes.fFloat4) {
190 context.fErrors->error(var->fLine, "sk_RTAdjust must have type 'float4'");
204 std::unique_ptr<Statement> VarDeclaration::Make(const Context& context, Variable* var,