mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-23 18:10:36 +02:00
nir: add nir_var_all enum
Otherwise, passing -1 gets you: error: invalid conversion from 'int' to 'nir_variable_mode' [-fpermissive] Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
parent
769b3ab6c5
commit
006e4f070f
4 changed files with 7 additions and 2 deletions
|
|
@ -107,6 +107,10 @@ void
|
|||
nir_shader_add_variable(nir_shader *shader, nir_variable *var)
|
||||
{
|
||||
switch (var->data.mode) {
|
||||
case nir_var_all:
|
||||
assert(!"invalid mode");
|
||||
break;
|
||||
|
||||
case nir_var_local:
|
||||
assert(!"nir_shader_add_variable cannot be used for local variables");
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ typedef struct {
|
|||
} nir_state_slot;
|
||||
|
||||
typedef enum {
|
||||
nir_var_all = -1,
|
||||
nir_var_shader_in,
|
||||
nir_var_shader_out,
|
||||
nir_var_global,
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ nir_lower_io_block(nir_block *block, void *void_state)
|
|||
|
||||
nir_variable_mode mode = intrin->variables[0]->var->data.mode;
|
||||
|
||||
if (state->mode != -1 && state->mode != mode)
|
||||
if (state->mode != nir_var_all && state->mode != mode)
|
||||
continue;
|
||||
|
||||
if (mode != nir_var_shader_in &&
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ brw_create_nir(struct brw_context *brw,
|
|||
nir_assign_var_locations(&nir->uniforms,
|
||||
&nir->num_uniforms,
|
||||
is_scalar ? type_size_scalar : type_size_vec4);
|
||||
OPT_V(nir_lower_io, -1, is_scalar ? type_size_scalar : type_size_vec4);
|
||||
OPT_V(nir_lower_io, nir_var_all, is_scalar ? type_size_scalar : type_size_vec4);
|
||||
|
||||
OPT(nir_remove_dead_variables);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue