diff --git a/src/intel/compiler/brw_compile_mesh.cpp b/src/intel/compiler/brw_compile_mesh.cpp index 0c6c568558f..28110f4ef8c 100644 --- a/src/intel/compiler/brw_compile_mesh.cpp +++ b/src/intel/compiler/brw_compile_mesh.cpp @@ -551,28 +551,6 @@ brw_mue_assign_position(const struct attr_desc *attr, } } -static nir_variable * -brw_nir_find_complete_variable_with_location(nir_shader *shader, - nir_variable_mode mode, - int location) -{ - nir_variable *best_var = NULL; - unsigned last_size = 0; - - nir_foreach_variable_with_modes(var, shader, mode) { - if (var->data.location != location) - continue; - - unsigned new_size = glsl_count_dword_slots(var->type, false); - if (new_size > last_size) { - best_var = var; - last_size = new_size; - } - } - - return best_var; -} - static unsigned brw_sum_size(const std::list &orders) { diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index c51269f9f41..9acf4eb1f7c 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -2548,3 +2548,25 @@ brw_nir_lower_simd(nir_shader *nir, unsigned dispatch_width) return nir_shader_lower_instructions(nir, filter_simd, lower_simd, (void *)(uintptr_t)dispatch_width); } + +nir_variable * +brw_nir_find_complete_variable_with_location(nir_shader *shader, + nir_variable_mode mode, + int location) +{ + nir_variable *best_var = NULL; + unsigned last_size = 0; + + nir_foreach_variable_with_modes(var, shader, mode) { + if (var->data.location != location) + continue; + + unsigned new_size = glsl_count_dword_slots(var->type, false); + if (new_size > last_size) { + best_var = var; + last_size = new_size; + } + } + + return best_var; +} diff --git a/src/intel/compiler/brw_nir.h b/src/intel/compiler/brw_nir.h index 2a6daa86fc3..9b9814a6cf5 100644 --- a/src/intel/compiler/brw_nir.h +++ b/src/intel/compiler/brw_nir.h @@ -318,6 +318,10 @@ bool brw_nir_uses_inline_data(nir_shader *shader); nir_shader * brw_nir_from_spirv(void *mem_ctx, const uint32_t *spirv, size_t spirv_size); +nir_variable * +brw_nir_find_complete_variable_with_location(nir_shader *shader, + nir_variable_mode mode, + int location); #ifdef __cplusplus } #endif