summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2015-10-05 11:42:43 +0200
committerIago Toral Quiroga <[email protected]>2015-10-14 08:08:12 +0200
commit9de651b261286f15ae000e4a698587b805b95d2b (patch)
tree574c599c2adf9b0b770f66e160d605be23f5a832 /src/glsl/ir.h
parentbaee16bf02eedc6a32381d79da6c7ac942f782ae (diff)
glsl: Fix variable_referenced() for vector_{extract,insert} expressions
We get these when we operate on vector variables with array accessors (i.e. things like a[0] where 'a' is a vec4). When we call variable_referenced() on these expressions we want to return a reference to 'a' instead of NULL. This fixes a problem where we pass a[0] as the first argument to an atomic SSBO function that expects a buffer variable. In order to check this, we use variable_referenced(), but that is currently returning NULL in this case, since the underlying rvalue is a vector_extract expression. Tested-by: Markus Wick <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 43a2bf0ae1c..9c9f22d018b 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1731,6 +1731,8 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
+ virtual ir_variable *variable_referenced() const;
+
ir_expression_operation operation;
ir_rvalue *operands[4];
};