From d5baad2afaef67b8a6187ed885cb6149bbe2314e Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Fri, 30 Jun 2023 03:40:03 +0800 Subject: [PATCH] microsoft/compiler: convert to use nir_foreach_function_with_impl in function emit_module Signed-off-by: Yonggang Luo Reviewed-by: Jesse Natalie Part-of: --- src/microsoft/compiler/nir_to_dxil.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 336636881b8..edcce78d6a3 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -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; }