summaryrefslogtreecommitdiffstats
path: root/src/gallium/tests/trivial/tri.c
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2012-04-25 22:16:26 +0200
committerFrancisco Jerez <[email protected]>2012-05-11 12:39:44 +0200
commit66f7fd99fa1d8c8e3b09fadd5624db9968b67506 (patch)
tree823985fa137d154aa4557767f97f47d54191a954 /src/gallium/tests/trivial/tri.c
parent317be33d73228fe8b340de8e029ff24b6e0d95b5 (diff)
gallium/tests/trivial: Switch to the pipe loader.
It simplifies things slightly, and besides, it makes possible to execute the trivial tests on a hardware device instead of being limited to software rendering. Reviewed-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src/gallium/tests/trivial/tri.c')
-rw-r--r--src/gallium/tests/trivial/tri.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index 9190f7824e9..f3e1e944154 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -55,16 +55,12 @@
#include "util/u_memory.h"
/* util_make_[fragment|vertex]_passthrough_shader */
#include "util/u_simple_shaders.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"
+/* to get a hardware pipe driver */
+#include "pipe-loader/pipe_loader.h"
struct program
{
+ struct pipe_loader_device *dev;
struct pipe_screen *screen;
struct pipe_context *pipe;
struct cso_context *cso;
@@ -88,10 +84,15 @@ struct program
static void init_prog(struct program *p)
{
struct pipe_surface surf_tmpl;
- /* create the software rasterizer */
- p->screen = sw_screen_create(null_sw_create());
- /* wrap the screen with any debugger */
- p->screen = debug_screen_wrap(p->screen);
+ int ret;
+
+ /* find a hardware device */
+ ret = pipe_loader_probe(&p->dev, 1);
+ assert(ret);
+
+ /* init a pipe screen */
+ p->screen = pipe_loader_create_screen(p->dev, PIPE_SEARCH_DIR);
+ assert(p->screen);
/* create the pipe driver context and cso context */
p->pipe = p->screen->context_create(p->screen, NULL);
@@ -234,6 +235,7 @@ static void close_prog(struct program *p)
cso_destroy_context(p->cso);
p->pipe->destroy(p->pipe);
p->screen->destroy(p->screen);
+ pipe_loader_release(&p->dev, 1);
FREE(p);
}