From 3349517351059dcd70a81b31bdffe9835bd8f216 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Sun, 9 Jan 2011 21:04:41 -0500 Subject: noop: make noop useable like trace or rbug If you want to enable noop set GALLIUM_NOOP=1 as an env variable. You need first to enable noop wrapping for your driver see change to src/gallium/targets/dri-r600/ in this commit as an example. Signed-off-by: Jerome Glisse --- .../auxiliary/target-helpers/inline_noop_helper.h | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/gallium/auxiliary/target-helpers/inline_noop_helper.h (limited to 'src/gallium/auxiliary/target-helpers') diff --git a/src/gallium/auxiliary/target-helpers/inline_noop_helper.h b/src/gallium/auxiliary/target-helpers/inline_noop_helper.h new file mode 100644 index 0000000000..77c7cfd0c2 --- /dev/null +++ b/src/gallium/auxiliary/target-helpers/inline_noop_helper.h @@ -0,0 +1,51 @@ + +#ifndef INLINE_DEBUG_HELPER_H +#define INLINE_DEBUG_HELPER_H + +#include "pipe/p_compiler.h" +#include "util/u_debug.h" + + +/* Helper function to wrap a screen with + * one or more debug driver: rbug, trace. + */ + +#ifdef GALLIUM_TRACE +#include "trace/tr_public.h" +#endif + +#ifdef GALLIUM_RBUG +#include "rbug/rbug_public.h" +#endif + +#ifdef GALLIUM_GALAHAD +#include "galahad/glhd_public.h" +#endif + +#ifdef GALLIUM_NOOP +#include "noop/noop_public.h" +#endif + +static INLINE struct pipe_screen * +debug_screen_wrap(struct pipe_screen *screen) +{ +#if defined(GALLIUM_RBUG) + screen = rbug_screen_create(screen); +#endif + +#if defined(GALLIUM_TRACE) + screen = trace_screen_create(screen); +#endif + +#if defined(GALLIUM_GALAHAD) + screen = galahad_screen_create(screen); +#endif + +#if defined(GALLIUM_NOOP) + screen = noop_screen_create(screen); +#endif + + return screen; +} + +#endif -- cgit v1.2.3