1 2 #ifndef INLINE_DEBUG_HELPER_H 3 #define INLINE_DEBUG_HELPER_H 4 5 #include "util/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_noop/noop_public.h" 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 /* 23 * TODO: Audit the following *screen_create() - all of 24 * them should return the original screen on failuire. 25 */ 26 static inline struct pipe_screen * debug_screen_wrap(struct pipe_screen * screen)27debug_screen_wrap(struct pipe_screen *screen) 28 { 29 screen = ddebug_screen_create(screen); 30 screen = trace_screen_create(screen); 31 screen = noop_screen_create(screen); 32 33 if (debug_get_bool_option("GALLIUM_TESTS", false)) 34 util_run_tests(screen); 35 36 return screen; 37 } 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #endif // INLINE_DEBUG_HELPER_H 44