nir/print: show variable precision
authorRob Clark <robdclark@chromium.org>
Wed, 4 Mar 2020 19:54:26 +0000 (11:54 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Mar 2020 16:01:39 +0000 (16:01 +0000)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>

src/compiler/nir/nir_print.c

index d4bc70a6aef59f7f95f8826497aa30761f7cbe4a..41a60aeefa52a54ec3ea352f174c922a2d6e247f 100644 (file)
@@ -478,6 +478,16 @@ print_var_decl(nir_variable *var, print_state *state)
       fprintf(fp, "%s ", util_format_short_name(var->data.image.format));
    }
 
+   if (var->data.precision) {
+      const char *precisions[] = {
+         "",
+         "highp",
+         "mediump",
+         "lowp",
+      };
+      fprintf(fp, "%s ", precisions[var->data.precision]);
+   }
+
    fprintf(fp, "%s %s", glsl_get_type_name(var->type),
            get_var_name(var, state));