From fa4ebf6b8d93bdf5c47bdaa5d5b3df060d260c6d Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 19 Apr 2017 18:08:28 +0200 Subject: glsl: add _mesa_glsl_parse_state object to is_lvalue() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Nicolai Hähnle Reviewed-by: Timothy Arceri --- src/compiler/glsl/ir.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/compiler/glsl/ir.cpp') diff --git a/src/compiler/glsl/ir.cpp b/src/compiler/glsl/ir.cpp index 590d2ad1c4b..22853f0ef38 100644 --- a/src/compiler/glsl/ir.cpp +++ b/src/compiler/glsl/ir.cpp @@ -24,6 +24,8 @@ #include "main/core.h" /* for MAX2 */ #include "ir.h" #include "compiler/glsl_types.h" +#include "glsl_parser_extras.h" + ir_rvalue::ir_rvalue(enum ir_node_type t) : ir_instruction(t) @@ -1436,7 +1438,7 @@ ir_dereference_record::ir_dereference_record(ir_variable *var, } bool -ir_dereference::is_lvalue() const +ir_dereference::is_lvalue(const struct _mesa_glsl_parse_state *state) const { ir_variable *var = this->variable_referenced(); -- cgit v1.2.3