Mesa (master): nir/print: print tex dest type
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 11 22:24:44 UTC 2020
Module: Mesa
Branch: master
Commit: 399114329b2bd53c3695186a1e0979dccb10f54f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=399114329b2bd53c3695186a1e0979dccb10f54f
Author: Rob Clark <robdclark at chromium.org>
Date: Thu Jun 11 09:43:11 2020 -0700
nir/print: print tex dest type
Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5431>
---
src/compiler/nir/nir_print.c | 40 +++++++++++++++++++++++++---------------
1 file changed, 25 insertions(+), 15 deletions(-)
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index c3efec8a692..e83d411f295 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -726,6 +726,26 @@ vulkan_descriptor_type_name(VkDescriptorType type)
}
}
+static void
+print_alu_type(nir_alu_type type, print_state *state)
+{
+ FILE *fp = state->fp;
+ unsigned size = nir_alu_type_get_type_size(type);
+ const char *name;
+
+ switch (nir_alu_type_get_base_type(type)) {
+ case nir_type_int: name = "int"; break;
+ case nir_type_uint: name = "uint"; break;
+ case nir_type_bool: name = "bool"; break;
+ case nir_type_float: name = "float"; break;
+ default: name = "invalid";
+ }
+ if (size)
+ fprintf(fp, "%s%u", name, size);
+ else
+ fprintf(fp, "%s", name);
+}
+
static void
print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
{
@@ -840,20 +860,8 @@ print_intrinsic_instr(nir_intrinsic_instr *instr, print_state *state)
}
case NIR_INTRINSIC_TYPE: {
- nir_alu_type type = nir_intrinsic_type(instr);
- unsigned size = nir_alu_type_get_type_size(type);
- const char *name;
- switch (nir_alu_type_get_base_type(type)) {
- case nir_type_int: name = "int"; break;
- case nir_type_uint: name = "uint"; break;
- case nir_type_bool: name = "bool"; break;
- case nir_type_float: name = "float"; break;
- default: name = "invalid";
- }
- if (size)
- fprintf(fp, " type=%s%u", name, size);
- else
- fprintf(fp, " type=%s", name);
+ fprintf(fp, " type=");
+ print_alu_type(nir_intrinsic_type(instr), state);
break;
}
@@ -967,7 +975,9 @@ print_tex_instr(nir_tex_instr *instr, print_state *state)
print_dest(&instr->dest, state);
- fprintf(fp, " = ");
+ fprintf(fp, " = (");
+ print_alu_type(instr->dest_type, state);
+ fprintf(fp, ")");
switch (instr->op) {
case nir_texop_tex:
More information about the mesa-commit
mailing list