• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 driver: rbug, trace.
12  */
13 
14 #ifdef GALLIUM_DDEBUG
15 #include "ddebug/dd_public.h"
16 #endif
17 
18 #ifdef GALLIUM_TRACE
19 #include "trace/tr_public.h"
20 #endif
21 
22 #ifdef GALLIUM_RBUG
23 #include "rbug/rbug_public.h"
24 #endif
25 
26 #ifdef GALLIUM_NOOP
27 #include "noop/noop_public.h"
28 #endif
29 
30 /*
31  * TODO: Audit the following *screen_create() - all of
32  * them should return the original screen on failuire.
33  */
34 static inline struct pipe_screen *
debug_screen_wrap(struct pipe_screen * screen)35 debug_screen_wrap(struct pipe_screen *screen)
36 {
37 #if defined(GALLIUM_DDEBUG)
38    screen = ddebug_screen_create(screen);
39 #endif
40 
41 #if defined(GALLIUM_RBUG)
42    screen = rbug_screen_create(screen);
43 #endif
44 
45 #if defined(GALLIUM_TRACE)
46    screen = trace_screen_create(screen);
47 #endif
48 
49 #if defined(GALLIUM_NOOP)
50    screen = noop_screen_create(screen);
51 #endif
52 
53    if (debug_get_bool_option("GALLIUM_TESTS", FALSE))
54       util_run_tests(screen);
55 
56    return screen;
57 }
58 
59 #endif
60