Debian Codegraph @

src/panfrost/compiler/bifrost/bi_debug.c

raw
1 /*
2 * Copyright (C) 2020 Collabora Ltd.
3 * Copyright (C) 2022 Alyssa Rosenzweig
4 * Copyright (C) 2025 Arm Ltd.
5 * SPDX-License-Identifier: MIT
6 */
7
8 #include "util/u_debug.h"
9 #include "bi_debug.h"
10
11
12 /* clang-format off */
13 static const struct debug_named_value bifrost_debug_options[] = {
14 {"shaders", BIFROST_DBG_SHADERS, "Dump shaders in NIR and MIR"},
15 {"shaderdb", BIFROST_DBG_SHADERDB, "Print statistics"},
16 {"verbose", BIFROST_DBG_VERBOSE, "Disassemble verbosely"},
17 {"internal", BIFROST_DBG_INTERNAL, "Dump even internal shaders"},
18 {"nosched", BIFROST_DBG_NOSCHED, "Force trivial bundling"},
19 {"nopsched", BIFROST_DBG_NOPSCHED, "Disable scheduling for pressure"},
20 {"inorder", BIFROST_DBG_INORDER, "Force in-order bundling"},
21 {"novalidate", BIFROST_DBG_NOVALIDATE, "Skip IR validation"},
22 {"noopt", BIFROST_DBG_NOOPT, "Skip optimization passes"},
23 {"noidvs", BIFROST_DBG_NOIDVS, "Disable IDVS"},
24 {"nosb", BIFROST_DBG_NOSB, "Disable scoreboarding"},
25 {"nopreload", BIFROST_DBG_NOPRELOAD, "Disable message preloading"},
26 {"spill", BIFROST_DBG_SPILL, "Test register spilling"},
27 {"nossara", BIFROST_DBG_NOSSARA, "Disable SSA in register allocation"},
28 {"statsabs", BIFROST_DBG_STATSABS, "Don't normalize statistics"},
29 {"statsfull", BIFROST_DBG_STATSFULL, "Print verbose statistics"},
30 {"debuginfo", BIFROST_DBG_DEBUGINFO, "Print debug information"},
31 DEBUG_NAMED_VALUE_END
32 };
33 /* clang-format on */
34
35 DEBUG_GET_ONCE_FLAGS_OPTION(bifrost_debug, "BIFROST_MESA_DEBUG",
36 bifrost_debug_options, 0)
37
38 unsigned bifrost_debug = 0;
39
40 void
41 bifrost_init_debug_options() {
42 bifrost_debug = debug_get_option_bifrost_debug();
43 }
44
45 bool
46 bifrost_will_dump_shaders(void)
47 {
48 bifrost_init_debug_options();
49 return bifrost_debug & BIFROST_DBG_SHADERS;
50 }
51
52 bool
53 bifrost_want_debug_info(void)
54 {
55 bifrost_init_debug_options();
56 return bifrost_debug & BIFROST_DBG_DEBUGINFO;
57 }
58