intel/fs: tidy up lower of ray queries
We already expect a single function. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15946>
This commit is contained in:
parent
9fd02d49b8
commit
8ef8e72aac
|
@ -562,29 +562,21 @@ brw_nir_lower_ray_queries(nir_shader *shader,
|
||||||
assert(exec_list_length(&shader->functions) == 1);
|
assert(exec_list_length(&shader->functions) == 1);
|
||||||
|
|
||||||
/* Find query variables */
|
/* Find query variables */
|
||||||
nir_foreach_function(function, shader) {
|
nir_function_impl *impl = nir_shader_get_entrypoint(shader);
|
||||||
if (!function->impl)
|
nir_foreach_block_safe(block, impl) {
|
||||||
continue;
|
|
||||||
|
|
||||||
nir_foreach_block_safe(block, function->impl) {
|
|
||||||
nir_foreach_instr(instr, block)
|
nir_foreach_instr(instr, block)
|
||||||
maybe_create_brw_var(instr, &state);
|
maybe_create_brw_var(instr, &state);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool progress = false;
|
bool progress = _mesa_hash_table_num_entries(state.queries) > 0;
|
||||||
if (_mesa_hash_table_num_entries(state.queries) > 0) {
|
|
||||||
nir_foreach_function(function, shader) {
|
if (progress) {
|
||||||
if (function->impl)
|
lower_ray_query_impl(impl, &state);
|
||||||
lower_ray_query_impl(function->impl, &state);
|
|
||||||
}
|
|
||||||
|
|
||||||
nir_remove_dead_derefs(shader);
|
nir_remove_dead_derefs(shader);
|
||||||
nir_remove_dead_variables(shader,
|
nir_remove_dead_variables(shader,
|
||||||
nir_var_shader_temp | nir_var_function_temp,
|
nir_var_shader_temp | nir_var_function_temp,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
progress = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ralloc_free(state.queries);
|
ralloc_free(state.queries);
|
||||||
|
|
Loading…
Reference in New Issue