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