summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-06-22 12:59:19 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-07-13 13:27:40 +0200
commit0c05971920b4bea9b6480fb84f56748d5fbce81b (patch)
tree2e77fd26b1685a0312fd6a133fc86c8b540dd150
parent9356ba751f77bcb3d4be87c7339d2d3ec13ca015 (diff)
nir: initialize nir_variable::data.location to -1
SPIR-V for ARB_gl_spirv seems to allow default-block uniforms without location, and so this guarantees that we default to "no explicit location".
-rw-r--r--src/compiler/nir/nir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index bb4e6843d0..bc50dfa975 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -169,6 +169,8 @@ nir_variable_create(nir_shader *shader, nir_variable_mode mode,
if (mode == nir_var_shader_in || mode == nir_var_uniform)
var->data.read_only = true;
+ var->data.location = -1;
+
nir_shader_add_variable(shader, var);
return var;