[Mesa-dev] [PATCH 6/8] compiler/nir: Print image formats in nir_print
Jason Ekstrand
jason at jlekstrand.net
Thu Jul 13 07:32:16 UTC 2017
---
src/compiler/nir/nir_print.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c
index 66c0669..deacf86 100644
--- a/src/compiler/nir/nir_print.c
+++ b/src/compiler/nir/nir_print.c
@@ -406,8 +406,12 @@ print_var_decl(nir_variable *var, print_state *state)
const char *const wonly = (var->data.image.write_only) ? "writeonly " : "";
fprintf(fp, "%s%s%s%s%s", coher, volat, restr, ronly, wonly);
- fprintf(fp, "%s %s", glsl_get_type_name(var->type),
- get_var_name(var, state));
+ fprintf(fp, "%s", glsl_get_type_name(var->type));
+
+ if (glsl_type_is_image(glsl_without_array(var->type)))
+ fprintf(fp, "(%s)", gl_image_format_name(var->data.image.format));
+
+ fprintf(fp, " %s", get_var_name(var, state));
if (var->data.mode == nir_var_shader_in ||
var->data.mode == nir_var_shader_out ||
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list