microsoft/spirv_to_dxil: Implement TODO for removing dead functions

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Reviewed-by: Michael Tang <tangm@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9846>
This commit is contained in:
Jesse Natalie 2021-03-25 18:22:44 -07:00 committed by Marge Bot
parent bd64669fa7
commit 39aa32b838

View file

@ -61,10 +61,18 @@ spirv_to_dxil(const uint32_t *words, size_t word_count,
NIR_PASS_V(nir, nir_opt_deref);
NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, nir_inline_functions);
// todo remove all non-entrypoint functions
NIR_PASS_V(nir, nir_lower_variable_initializers,
~nir_var_function_temp);
// Pick off the single entrypoint that we want.
nir_function *entrypoint;
foreach_list_typed_safe(nir_function, func, node, &nir->functions) {
if (func->is_entrypoint)
entrypoint = func;
else
exec_node_remove(&func->node);
}
assert(exec_list_length(&nir->functions) == 1);
struct nir_to_dxil_options opts = {0};
struct blob dxil_blob;