X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fvalidate.cpp;h=4b38c5b755e935f0e3f477c0ecd092202e411c7f;hb=b89239e1d616f0c1d8e432b7df1eca149585cf5e;hp=13cb5ccb23ad15e4d6e56798552ffcd35fefd381;hpb=6cb4cc995865935d22b276801c218d2dcf49cebd;p=libs%2Fgl.git diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 13cb5ccb..4b38c5b7 100644 --- a/source/glsl/validate.cpp +++ b/source/glsl/validate.cpp @@ -338,8 +338,14 @@ void ExpressionValidator::visit(UnaryExpression &unary) void ExpressionValidator::visit(BinaryExpression &binary) { if(!binary.type && binary.left->type && binary.right->type) - error(binary, format("No matching operator '%s' found for '%s' and '%s'", - binary.oper->token, binary.left->type->name, binary.right->type->name)); + { + if(binary.oper->token[0]=='[') + error(binary, format("Can't index element of '%s' with '%s'", + binary.left->type->name, binary.right->type->name)); + else + error(binary, format("No matching operator '%s' found for '%s' and '%s'", + binary.oper->token, binary.left->type->name, binary.right->type->name)); + } TraversingVisitor::visit(binary); }