summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-02-12 11:58:06 -0800
committerJason Ekstrand <[email protected]>2016-03-12 15:48:36 -0800
commit2ef4754a20be5fc7a6ecc2a8b6b8041637c998c6 (patch)
tree088f92d325c29e0707e0bf0be4cb08b146399751 /src/compiler/nir/nir.h
parent41ae553fdae5d0ff687733c45b6151a45759b2fd (diff)
nir: Add a new "param" variable mode for parameters and return variables
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r--src/compiler/nir/nir.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index cfbac81dbb1..ede56953d0a 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -88,7 +88,8 @@ typedef enum {
nir_var_local,
nir_var_uniform,
nir_var_shader_storage,
- nir_var_system_value
+ nir_var_system_value,
+ nir_var_param,
} nir_variable_mode;
/**
@@ -331,6 +332,12 @@ typedef struct nir_variable {
#define nir_foreach_variable(var, var_list) \
foreach_list_typed(nir_variable, var, node, var_list)
+static inline bool
+nir_variable_is_global(const nir_variable *var)
+{
+ return var->data.mode != nir_var_local && var->data.mode != nir_var_param;
+}
+
typedef struct nir_register {
struct exec_node node;