diff options
author | Rhys Perry <[email protected]> | 2019-03-19 20:24:35 +0000 |
---|---|---|
committer | Rhys Perry <[email protected]> | 2019-11-25 13:59:11 +0000 |
commit | c14f823ee5e109a0051225a24685e3fa015abb49 (patch) | |
tree | 41e89f97a76d7301188329c3b3ce06efa3c3d456 /src/compiler | |
parent | 01eb6ef8700fa850ea63cdf0e6a4be1af2b26e9a (diff) |
nir: add nir_num_variable_modes and nir_var_mem_push_const
These will be useful in the upcoming load/store vectorizer.
v11: rebase
Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Connor Abbott <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir.c | 5 | ||||
-rw-r--r-- | src/compiler/nir/nir.h | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 8a100e18dd8..552b42dd4e1 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -108,6 +108,7 @@ void nir_shader_add_variable(nir_shader *shader, nir_variable *var) { switch (var->data.mode) { + case nir_num_variable_modes: case nir_var_all: assert(!"invalid mode"); break; @@ -146,6 +147,10 @@ nir_shader_add_variable(nir_shader *shader, nir_variable *var) case nir_var_system_value: exec_list_push_tail(&shader->system_values, &var->node); break; + + case nir_var_mem_push_const: + assert(!"nir_var_push_constant is not supposed to be used for variables"); + break; } } diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 1333a49c66f..d9f3034cfe4 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -107,7 +107,9 @@ typedef enum { nir_var_mem_ssbo = (1 << 7), nir_var_mem_shared = (1 << 8), nir_var_mem_global = (1 << 9), - nir_var_all = (1 << 10) - 1, + nir_var_mem_push_const = (1 << 10), /* not actually used for variables */ + nir_num_variable_modes = 11, + nir_var_all = (1 << nir_num_variable_modes) - 1, } nir_variable_mode; /** @@ -314,7 +316,7 @@ typedef struct nir_variable { * * \sa nir_variable_mode */ - nir_variable_mode mode:10; + nir_variable_mode mode:11; /** * Is the variable read-only? |