nir: Convert nir_variable_mode to a bitfield

There are several passes where we need to specify some set of variable
modes that the pass needs top operate on.  This lets us easily do that.

Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
Jason Ekstrand
2016-04-11 13:32:59 -07:00
parent f69a61b1aa
commit ffa0e12e15
2 changed files with 19 additions and 17 deletions

View File

@@ -81,16 +81,16 @@ typedef struct {
} nir_state_slot;
typedef enum {
nir_var_all = -1,
nir_var_shader_in,
nir_var_shader_out,
nir_var_global,
nir_var_local,
nir_var_uniform,
nir_var_shader_storage,
nir_var_system_value,
nir_var_param,
nir_var_shared,
nir_var_shader_in = (1 << 0),
nir_var_shader_out = (1 << 1),
nir_var_global = (1 << 2),
nir_var_local = (1 << 3),
nir_var_uniform = (1 << 4),
nir_var_shader_storage = (1 << 5),
nir_var_system_value = (1 << 6),
nir_var_param = (1 << 7),
nir_var_shared = (1 << 8),
nir_var_all = ~0,
} nir_variable_mode;
/**
@@ -156,6 +156,12 @@ typedef struct nir_variable {
char *name;
struct nir_variable_data {
/**
* Storage class of the variable.
*
* \sa nir_variable_mode
*/
nir_variable_mode mode;
/**
* Is the variable read-only?
@@ -169,13 +175,6 @@ typedef struct nir_variable {
unsigned patch:1;
unsigned invariant:1;
/**
* Storage class of the variable.
*
* \sa nir_variable_mode
*/
nir_variable_mode mode:5;
/**
* Interpolation mode for shader inputs / outputs
*