[Mesa-dev] [PATCH 07/16] nir/print: add type names for deref instr

Jason Ekstrand jason at jlekstrand.net
Sat Apr 7 16:57:35 UTC 2018


Yeah, something like this would be good.  I don't like how the syntax
clashes with casts though.  I'll think on it. :-)

On Sat, Apr 7, 2018 at 9:13 AM, Rob Clark <robdclark at gmail.com> wrote:

> It was only shown in deref_cast instructions.  But it makes things
> easier to follow to show the intermediate types in deref_array/
> deref_struct instructions too.
>
> Signed-off-by: Rob Clark <robdclark at gmail.com>
> ---
>  src/compiler/nir/nir_print.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
> index 7d7542a4113..5cec6a49963 100644
> --- a/src/compiler/nir/nir_print.c
> +++ b/src/compiler/nir/nir_print.c
> @@ -504,9 +504,10 @@ print_deref_instr(nir_deref_instr *instr,
> print_state *state)
>        return;
>     }
>
> -   fprintf(fp, " = deref_%s (%s) &",
> +   fprintf(fp, " = deref_%s (%s) (%s *)&",
>            (instr->deref_type == nir_deref_type_struct) ? "struct" :
> "array",
> -          get_variable_mode_str(instr->mode));
> +          get_variable_mode_str(instr->mode),
> +          glsl_get_type_name(instr->type));
>     print_src(&instr->parent, state);
>
>     assert(instr->parent.is_ssa);
> --
> 2.14.3
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180407/474c59b0/attachment.html>


More information about the mesa-dev mailing list