diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index 6310149031a82a84771e8b7223a1b64c05f30d89..47691a5926ae907665ed461fd85bf19bf99aa52f 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -1668,6 +1668,7 @@ lower_vars_to_explicit(nir_shader *shader, unsigned offset; switch (mode) { case nir_var_uniform: + case nir_var_shader_in: assert(shader->info.stage == MESA_SHADER_KERNEL); offset = 0; break; @@ -1685,6 +1686,9 @@ lower_vars_to_explicit(nir_shader *shader, unreachable("Unsupported mode"); } nir_foreach_variable(var, vars) { + if (var->data.mode != mode) + continue; + unsigned size, align; const struct glsl_type *explicit_type = glsl_get_explicit_type_for_size_align(var->type, type_info, &size, &align); @@ -1699,6 +1703,7 @@ lower_vars_to_explicit(nir_shader *shader, switch (mode) { case nir_var_uniform: + case nir_var_shader_in: assert(shader->info.stage == MESA_SHADER_KERNEL); shader->num_uniforms = offset; break; @@ -1731,14 +1736,18 @@ nir_lower_vars_to_explicit_types(nir_shader *shader, * - interface types */ ASSERTED nir_variable_mode supported = - nir_var_mem_shared | nir_var_mem_global | - nir_var_shader_temp | nir_var_function_temp | nir_var_uniform; + nir_var_mem_shared | nir_var_mem_global | nir_var_mem_constant | + nir_var_shader_temp | nir_var_function_temp | nir_var_uniform | nir_var_shader_in; assert(!(modes & ~supported) && "unsupported"); bool progress = false; if (modes & nir_var_uniform) - progress |= lower_vars_to_explicit(shader, &shader->variables, nir_var_uniform, type_info); + progress |= lower_vars_to_explicit(shader, &shader->uniforms, nir_var_uniform, type_info); + if (modes & nir_var_mem_constant) + progress |= lower_vars_to_explicit(shader, &shader->uniforms, nir_var_mem_constant, type_info); + if (modes & nir_var_shader_in) + progress |= lower_vars_to_explicit(shader, &shader->inputs, nir_var_shader_in, type_info); if (modes & nir_var_mem_shared) progress |= lower_vars_to_explicit(shader, &shader->shared, nir_var_mem_shared, type_info); if (modes & nir_var_shader_temp)