summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-01-29 11:45:31 -0800
committerJason Ekstrand <[email protected]>2015-01-29 17:07:45 -0800
commit81f77e4f3a070ef9041c50495fd010e56c08cc6a (patch)
treedc78f90a04399adbf96858559fd5c1cd16ef6742 /src/glsl/nir
parent026b5cc79274af4a681d3ef41ccfd3b5fa5dc050 (diff)
nir/algebraic: Fail to compile of a variable is used in a replace but not the search
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/nir')
-rw-r--r--src/glsl/nir/nir_algebraic.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_algebraic.py b/src/glsl/nir/nir_algebraic.py
index f9b246dd865..75436f42ccc 100644
--- a/src/glsl/nir/nir_algebraic.py
+++ b/src/glsl/nir/nir_algebraic.py
@@ -34,13 +34,18 @@ class VarSet(object):
def __init__(self):
self.names = {}
self.ids = itertools.count()
+ self.immutable = False;
def __getitem__(self, name):
if name not in self.names:
+ assert not self.immutable, "Unknown replacement variable: " + name
self.names[name] = self.ids.next()
return self.names[name]
+ def lock(self):
+ self.immutable = True
+
class Value(object):
@staticmethod
def create(val, name_base, varset):
@@ -138,6 +143,8 @@ class SearchAndReplace(object):
else:
self.search = Expression(search, "search{0}".format(self.id), varset)
+ varset.lock()
+
if isinstance(replace, Value):
self.replace = replace
else: