aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir.h
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2019-11-15 15:15:14 +0000
committerRhys Perry <[email protected]>2019-11-20 15:05:42 +0000
commit9f92e8b72130df484862db3d07216a476348aadc (patch)
tree15c80ff27a8e7a303553dacd1849694bed5e5125 /src/compiler/nir/nir.h
parent45a0b5349082fba81dac7adf9a59c5a1b40baaa6 (diff)
nir: add nir_variable::index and nir_index_vars
This will be useful as a deterministic identifier/index for the variable. v2: fix comment style Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Connor Abbott <[email protected]> (v1)
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r--src/compiler/nir/nir.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 4db85b3fafd..e88d3f8df96 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -504,6 +504,12 @@ typedef struct nir_variable {
};
} data;
+ /**
+ * Identifier for this variable generated by nir_index_vars() that is unique
+ * among other variables in the same exec_list.
+ */
+ unsigned index;
+
/* Number of nir_variable_data members */
uint16_t num_members;
@@ -3340,6 +3346,8 @@ unsigned nir_index_instrs(nir_function_impl *impl);
void nir_index_blocks(nir_function_impl *impl);
+void nir_index_vars(nir_shader *shader, nir_function_impl *impl, nir_variable_mode modes);
+
void nir_print_shader(nir_shader *shader, FILE *fp);
void nir_print_shader_annotated(nir_shader *shader, FILE *fp, struct hash_table *errors);
void nir_print_instr(const nir_instr *instr, FILE *fp);