From ea9bde151f1394ff82b73d028c2a3a747723e525 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Tue, 4 Sep 2018 11:42:04 +0300 Subject: glsl: Cross validate variable's invariance by explicit invariance only 'invariant' qualifier is propagated on variables which are used to calculate other invariant variables, however when we are matching variable's declarations we should take into account only explicitly declared invariance because invariance propagation is an implementation specific detail. Thus new flag is added to ir_variable_data which indicates 'invariant' qualifier being explicitly set in the shader. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100316 Fixes: 89b60492 ('glsl: Add a pass to propagate the "invariant" and "precise" qualifiers') Signed-off-by: Danylo Piliaiev Reviewed-by: Jordan Justen --- src/compiler/glsl/ir_reader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/compiler/glsl/ir_reader.cpp') diff --git a/src/compiler/glsl/ir_reader.cpp b/src/compiler/glsl/ir_reader.cpp index b87933ba511..d4f0e58b155 100644 --- a/src/compiler/glsl/ir_reader.cpp +++ b/src/compiler/glsl/ir_reader.cpp @@ -419,8 +419,10 @@ ir_reader::read_declaration(s_expression *expr) var->data.sample = 1; } else if (strcmp(qualifier->value(), "patch") == 0) { var->data.patch = 1; + } else if (strcmp(qualifier->value(), "explicit_invariant") == 0) { + var->data.explicit_invariant = true; } else if (strcmp(qualifier->value(), "invariant") == 0) { - var->data.invariant = 1; + var->data.invariant = true; } else if (strcmp(qualifier->value(), "uniform") == 0) { var->data.mode = ir_var_uniform; } else if (strcmp(qualifier->value(), "shader_storage") == 0) { -- cgit v1.2.3