Mesa (master): gallium: Make trivial examples use target helpers

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Sun Jul 4 12:38:37 UTC 2010


Module: Mesa
Branch: master
Commit: ed5ce78b8146a485f418a3ca06e545ab297f6f93
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed5ce78b8146a485f418a3ca06e545ab297f6f93

Author: Jakob Bornecrantz <wallbraker at gmail.com>
Date:   Sun Jul  4 01:35:05 2010 +0100

gallium: Make trivial examples use target helpers

---

 src/gallium/tests/trivial/Makefile   |    5 +++++
 src/gallium/tests/trivial/quad-tex.c |   22 +++++++++-------------
 src/gallium/tests/trivial/tri.c      |   22 +++++++++-------------
 3 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/src/gallium/tests/trivial/Makefile b/src/gallium/tests/trivial/Makefile
index bfcbdd9..2ed6341 100644
--- a/src/gallium/tests/trivial/Makefile
+++ b/src/gallium/tests/trivial/Makefile
@@ -12,7 +12,9 @@ INCLUDES = \
 	$(PROG_INCLUDES)
 
 LINKS = \
+	$(TOP)/src/gallium/drivers/rbug/librbug.a \
 	$(TOP)/src/gallium/drivers/trace/libtrace.a \
+	$(TOP)/src/gallium/drivers/galahad/libgalahad.a \
 	$(TOP)/src/gallium/winsys/sw/null/libws_null.a \
 	$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a \
 	$(GALLIUM_AUXILIARIES) \
@@ -26,6 +28,9 @@ OBJECTS = $(SOURCES:.c=.o)
 
 PROGS = $(OBJECTS:.o=)
 
+PROG_DEFINES = \
+	-DGALLIUM_SOFTPIPE -DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_GALAHAD
+
 ##### TARGETS #####
 
 default: $(PROGS)
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index abcd477..cf88edc 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -58,18 +58,13 @@
 /* util_make_[fragment|vertex]_passthrough_shader */
 #include "util/u_simple_shaders.h"
 
-/* softpipe software driver */
-#include "softpipe/sp_public.h"
-
+/* sw_screen_create: to get a software pipe driver */
+#include "target-helpers/inline_sw_helper.h"
+/* debug_screen_wrap: to wrap with debug pipe drivers */
+#include "target-helpers/inline_debug_helper.h"
 /* null software winsys */
 #include "sw/null/null_sw_winsys.h"
 
-/* traceing support see src/gallium/drivers/trace/README for more info. */
-#if USE_TRACE
-#include "trace/tr_screen.h"
-#include "trace/tr_context.h"
-#endif
-
 struct program
 {
 	struct pipe_screen *screen;
@@ -98,10 +93,11 @@ struct program
 static void init_prog(struct program *p)
 {
 	/* create the software rasterizer */
-	p->screen = softpipe_create_screen(null_sw_create());
-#if USE_TRACE
-	p->screen = trace_screen_create(p->screen);
-#endif
+	p->screen = sw_screen_create(null_sw_create());
+	/* wrap the screen with any debugger */
+	p->screen = debug_screen_wrap(p->screen);
+
+	/* create the pipe driver context and cso context */
 	p->pipe = p->screen->context_create(p->screen, NULL);
 	p->cso = cso_create_context(p->pipe);
 
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index 7823c27..667a27b 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -56,18 +56,13 @@
 /* util_make_[fragment|vertex]_passthrough_shader */
 #include "util/u_simple_shaders.h"
 
-/* softpipe software driver */
-#include "softpipe/sp_public.h"
-
+/* sw_screen_create: to get a software pipe driver */
+#include "target-helpers/inline_sw_helper.h"
+/* debug_screen_wrap: to wrap with debug pipe drivers */
+#include "target-helpers/inline_debug_helper.h"
 /* null software winsys */
 #include "sw/null/null_sw_winsys.h"
 
-/* traceing support see src/gallium/drivers/trace/README for more info. */
-#if USE_TRACE
-#include "trace/tr_screen.h"
-#include "trace/tr_context.h"
-#endif
-
 struct program
 {
 	struct pipe_screen *screen;
@@ -93,10 +88,11 @@ struct program
 static void init_prog(struct program *p)
 {
 	/* create the software rasterizer */
-	p->screen = softpipe_create_screen(null_sw_create());
-#if USE_TRACE
-	p->screen = trace_screen_create(p->screen);
-#endif
+	p->screen = sw_screen_create(null_sw_create());
+	/* wrap the screen with any debugger */
+	p->screen = debug_screen_wrap(p->screen);
+
+	/* create the pipe driver context and cso context */
 	p->pipe = p->screen->context_create(p->screen, NULL);
 	p->cso = cso_create_context(p->pipe);
 




More information about the mesa-commit mailing list