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 "trace/tr_public.h"
19 #include "rbug/rbug_public.h"
23 #include "noop/noop_public.h"
27 * TODO: Audit the following *screen_create() - all of
28 * them should return the original screen on failuire.
30 static inline struct pipe_screen
*
31 debug_screen_wrap(struct pipe_screen
*screen
)
33 #if defined(GALLIUM_RBUG)
34 screen
= rbug_screen_create(screen
);
37 #if defined(GALLIUM_TRACE)
38 screen
= trace_screen_create(screen
);
41 #if defined(GALLIUM_NOOP)
42 screen
= noop_screen_create(screen
);
45 if (debug_get_bool_option("GALLIUM_TESTS", FALSE
))
46 util_run_tests(screen
);