[PATCH vkd3d 3/5] vkd3d-shader/hlsl: Dump only the entry point.

Matteo Bruni matteo.mystral at gmail.com
Thu Feb 24 08:08:28 CST 2022


On Wed, Feb 16, 2022 at 6:47 AM Zebediah Figura <zfigura at codeweavers.com> wrote:
>
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
>  libs/vkd3d-shader/hlsl_codegen.c | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
>
> diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c
> index eac3513c..20d4ffe9 100644
> --- a/libs/vkd3d-shader/hlsl_codegen.c
> +++ b/libs/vkd3d-shader/hlsl_codegen.c
> @@ -954,23 +954,6 @@ static unsigned int index_instructions(struct hlsl_block *block, unsigned int in
>      return index;
>  }
>
> -static void dump_function_decl(struct rb_entry *entry, void *context)
> -{
> -    struct hlsl_ir_function_decl *func = RB_ENTRY_VALUE(entry, struct hlsl_ir_function_decl, entry);
> -    struct hlsl_ctx *ctx = context;
> -
> -    if (func->has_body)
> -        hlsl_dump_function(ctx, func);
> -}
> -
> -static void dump_function(struct rb_entry *entry, void *context)
> -{
> -    struct hlsl_ir_function *func = RB_ENTRY_VALUE(entry, struct hlsl_ir_function, entry);
> -    struct hlsl_ctx *ctx = context;
> -
> -    rb_for_each_entry(&func->overloads, dump_function_decl, ctx);
> -}
> -
>  /* Compute the earliest and latest liveness for each variable. In the case that
>   * a variable is accessed inside of a loop, we promote its liveness to extend
>   * to at least the range of the entire loop. Note that we don't need to do this
> @@ -1814,7 +1797,7 @@ int hlsl_emit_dxbc(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *entry_fun
>      compute_liveness(ctx, entry_func);
>
>      if (TRACE_ON())
> -        rb_for_each_entry(&ctx->functions, dump_function, ctx);
> +        hlsl_dump_function(ctx, entry_func);
>
>      allocate_temp_registers(ctx, entry_func);
>      if (ctx->profile->major_version < 4)

I think we want to do this only once we have implemented inlining.
Actually, even with inlining, additionally dumping the whole initial
IR doesn't seem like a terrible idea (i.e. instead of removing
dump_function_decl() and dump_function(), moving the call to the start
of hlsl_emit_dxbc()).



More information about the wine-devel mailing list