aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/target-helpers/inline_debug_helper.h
blob: 08aea33071038f5c8d7da73824bbe78ff52fb41e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

#ifndef INLINE_DEBUG_HELPER_H
#define INLINE_DEBUG_HELPER_H

#include "pipe/p_compiler.h"
#include "util/u_debug.h"
#include "util/u_tests.h"


/* Helper function to wrap a screen with
 * one or more debug drivers.
 */

#include "driver_ddebug/dd_public.h"
#include "driver_trace/tr_public.h"
#include "driver_rbug/rbug_public.h"
#include "driver_noop/noop_public.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
 * TODO: Audit the following *screen_create() - all of
 * them should return the original screen on failuire.
 */
static inline struct pipe_screen *
debug_screen_wrap(struct pipe_screen *screen)
{
   screen = ddebug_screen_create(screen);
   screen = rbug_screen_create(screen);
   screen = trace_screen_create(screen);
   screen = noop_screen_create(screen);

   if (debug_get_bool_option("GALLIUM_TESTS", FALSE))
      util_run_tests(screen);

   return screen;
}

#ifdef __cplusplus
}
#endif

#endif // INLINE_DEBUG_HELPER_H