From bd33055ef4b6dd18d6247ff7d9e47496ff4acc51 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 7 Jan 2011 18:34:58 -0800 Subject: glsl: Track variable usage, use that to enforce semantics In particular, variables cannot be redeclared invariant after being used. Fixes piglit test invariant-05.vert and bugzilla #29164. NOTE: This is a candidate for the 7.9 and 7.10 branches. --- src/glsl/ir.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/glsl/ir.h') diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 9668c9439a..57e89f0f6b 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -294,6 +294,15 @@ public: unsigned centroid:1; unsigned invariant:1; + /** + * Has this variable been used for reading or writing? + * + * Several GLSL semantic checks require knowledge of whether or not a + * variable has been used. For example, it is an error to redeclare a + * variable as invariant after it has been used. + */ + unsigned used:1; + /** * Storage class of the variable. * -- cgit v1.2.3