gallium: move ddebug, noop, rbug, trace to auxiliary to improve build times
[mesa.git] / src / gallium / auxiliary / target-helpers / inline_debug_helper.h
1
2 #ifndef INLINE_DEBUG_HELPER_H
3 #define INLINE_DEBUG_HELPER_H
4
5 #include "pipe/p_compiler.h"
6 #include "util/u_debug.h"
7 #include "util/u_tests.h"
8
9
10 /* Helper function to wrap a screen with
11 * one or more debug drivers.
12 */
13
14 #include "driver_ddebug/dd_public.h"
15 #include "driver_trace/tr_public.h"
16 #include "driver_rbug/rbug_public.h"
17 #include "driver_noop/noop_public.h"
18
19 /*
20 * TODO: Audit the following *screen_create() - all of
21 * them should return the original screen on failuire.
22 */
23 static inline struct pipe_screen *
24 debug_screen_wrap(struct pipe_screen *screen)
25 {
26 screen = ddebug_screen_create(screen);
27 screen = rbug_screen_create(screen);
28 screen = trace_screen_create(screen);
29 screen = noop_screen_create(screen);
30
31 if (debug_get_bool_option("GALLIUM_TESTS", FALSE))
32 util_run_tests(screen);
33
34 return screen;
35 }
36
37 #endif