2 #ifndef INLINE_DEBUG_HELPER_H
3 #define INLINE_DEBUG_HELPER_H
5 #include "pipe/p_compiler.h"
6 #include "util/u_debug.h"
7 #include "util/u_tests.h"
10 /* Helper function to wrap a screen with
11 * one or more debug driver: rbug, trace.
15 #include "ddebug/dd_public.h"
19 #include "trace/tr_public.h"
23 #include "rbug/rbug_public.h"
27 #include "noop/noop_public.h"
31 * TODO: Audit the following *screen_create() - all of
32 * them should return the original screen on failuire.
34 static inline struct pipe_screen
*
35 debug_screen_wrap(struct pipe_screen
*screen
)
37 #if defined(GALLIUM_DDEBUG)
38 screen
= ddebug_screen_create(screen
);
41 #if defined(GALLIUM_RBUG)
42 screen
= rbug_screen_create(screen
);
45 #if defined(GALLIUM_TRACE)
46 screen
= trace_screen_create(screen
);
49 #if defined(GALLIUM_NOOP)
50 screen
= noop_screen_create(screen
);
53 if (debug_get_bool_option("GALLIUM_TESTS", FALSE
))
54 util_run_tests(screen
);