X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fnir%2Fnir_lower_io.c;h=58c4597c27eaae29022fd6308bda3bcc3abdf656;hb=7f25f1f106728f0046672adf9c9ed79185265ea5;hp=b004c62b81e25fc121011f2ef51fcb71f6bdbf90;hpb=e2e89fb137c220e035403d8dc6d00d6c44a4f675;p=mesa.git diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c index b004c62b81e..58c4597c27e 100644 --- a/src/compiler/nir/nir_lower_io.c +++ b/src/compiler/nir/nir_lower_io.c @@ -121,19 +121,13 @@ shared_atomic_for_deref(nir_intrinsic_op deref_op) } void -nir_assign_var_locations(struct exec_list *var_list, unsigned *size, +nir_assign_var_locations(nir_shader *shader, nir_variable_mode mode, + unsigned *size, int (*type_size)(const struct glsl_type *, bool)) { unsigned location = 0; - nir_foreach_variable(var, var_list) { - /* - * UBOs have their own address spaces, so don't count them towards the - * number of global uniforms - */ - if (var->data.mode == nir_var_mem_ubo || var->data.mode == nir_var_mem_ssbo) - continue; - + nir_foreach_variable_with_modes(var, shader, mode) { var->data.driver_location = location; bool bindless_type_size = var->data.mode == nir_var_shader_in || var->data.mode == nir_var_shader_out || @@ -1476,7 +1470,10 @@ lower_vars_to_explicit(nir_shader *shader, default: unreachable("Unsupported mode"); } - nir_foreach_variable(var, vars) { + nir_foreach_variable_in_list(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); @@ -1523,9 +1520,9 @@ nir_lower_vars_to_explicit_types(nir_shader *shader, bool progress = false; if (modes & nir_var_mem_shared) - progress |= lower_vars_to_explicit(shader, &shader->shared, nir_var_mem_shared, type_info); + progress |= lower_vars_to_explicit(shader, &shader->variables, nir_var_mem_shared, type_info); if (modes & nir_var_shader_temp) - progress |= lower_vars_to_explicit(shader, &shader->globals, nir_var_shader_temp, type_info); + progress |= lower_vars_to_explicit(shader, &shader->variables, nir_var_shader_temp, type_info); nir_foreach_function(function, shader) { if (function->impl) {