glsl: add _mesa_glsl_parse_state object to is_lvalue()

Yes, this is a bit hacky but we don't really have the choice.
Plain GLSL doesn't accept bindless samplers/images as l-values
while it's allowed when ARB_bindless_texture is enabled.

The default NULL parameter is because we can't access the
_mesa_glsl_parse_state object in few places in the compiler.
One is_lvalue(NULL) call is for IR validation but other checks
happen elsewhere, should be safe.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
Samuel Pitoiset
2017-04-19 18:08:28 +02:00
parent 42a2fe25f4
commit fa4ebf6b8d
4 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -283,7 +283,7 @@ verify_parameter_modes(_mesa_glsl_parse_state *state,
mode, formal->name,
actual->variable_referenced()->name);
return false;
} else if (!actual->is_lvalue()) {
} else if (!actual->is_lvalue(state)) {
_mesa_glsl_error(&loc, state,
"function parameter '%s %s' is not an lvalue",
mode, formal->name);