glsl: emit a specific error when ast_*_assign changes type
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 9 Jul 2016 03:28:22 +0000 (23:28 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sat, 13 Aug 2016 02:45:20 +0000 (22:45 -0400)
commita32c87f74be1beed546d6d8853933d1b48f42f18
tree7b80e8f56f223850fcf5f12dfba788eb2fc84c27
parentd816a51b81f42b0aa4819a32587b4aa167e4b541
glsl: emit a specific error when ast_*_assign changes type

For regular ast_add, we can implicitly change either a or b's type.
However in an assignment situation, the type of the lvalue is fixed. So
if the implicit conversion logic decides to change it, it means that the
rhs's type could not be converted to the lhs type.

Emit a specific error for this rather than the rather mysterious "is not
an lvalue" error that results from having a i2f or other operation as
the lvalue.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96729
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/compiler/glsl/ast_to_hir.cpp