microsoft/compiler: convert to use nir_foreach_function_with_impl in function emit_module

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23940>
This commit is contained in:
Yonggang Luo 2023-06-30 03:40:03 +08:00 committed by Marge Bot
parent 87109c3e1b
commit d5baad2afa

View file

@ -5885,13 +5885,9 @@ emit_scratch(struct ntd_context *ctx, nir_function_impl *impl)
}
static bool
emit_function(struct ntd_context *ctx, nir_function *func)
emit_function(struct ntd_context *ctx, nir_function *func, nir_function_impl *impl)
{
assert(func->num_params == 0);
nir_function_impl *impl = func->impl;
if (!impl)
return true;
nir_metadata_require(impl, nir_metadata_block_index);
const char *attr_keys[2] = { NULL };
@ -6077,8 +6073,8 @@ emit_module(struct ntd_context *ctx, const struct nir_to_dxil_options *opts)
ctx->shader->info.clip_distance_array_size : ctx->opts->input_clip_size;
preprocess_signatures(&ctx->mod, ctx->shader, input_clip_size);
nir_foreach_function(func, ctx->shader) {
if (!emit_function(ctx, func))
nir_foreach_function_with_impl(func, impl, ctx->shader) {
if (!emit_function(ctx, func, impl))
return false;
}