glsl: print precision qualifiers in IR dumps
authorMarek Olšák <marek.olsak@amd.com>
Wed, 24 Jun 2020 03:10:16 +0000 (23:10 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 8 Jul 2020 02:02:06 +0000 (22:02 -0400)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>

src/compiler/glsl/ir_print_visitor.cpp

index 57cb5076a4facb3b1def51974cca3e40a388b9f3..8914c6e2d0251d39f3f88c46f9380c9e8bc34b86 100644 (file)
@@ -214,14 +214,15 @@ void ir_print_visitor::visit(ir_variable *ir)
    STATIC_ASSERT(ARRAY_SIZE(mode) == ir_var_mode_count);
    const char *const interp[] = { "", "smooth", "flat", "noperspective", "explicit" };
    STATIC_ASSERT(ARRAY_SIZE(interp) == INTERP_MODE_COUNT);
+   const char *const precision[] = { "", "highp ", "mediump ", "lowp "};
 
-   fprintf(f, "(%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s) ",
+   fprintf(f, "(%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s) ",
            binding, loc, component, cent, bindless, bound,
            image_format, memory_read_only, memory_write_only,
            memory_coherent, memory_volatile, memory_restrict,
            samp, patc, inv, explicit_inv, prec, mode[ir->data.mode],
            stream,
-           interp[ir->data.interpolation]);
+           interp[ir->data.interpolation], precision[ir->data.precision]);
 
    ir_print_type(f, ir->type);
    fprintf(f, " %s)", unique_name(ir));