diff options
author | Francisco Jerez <[email protected]> | 2012-04-25 22:16:26 +0200 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2012-05-11 12:39:44 +0200 |
commit | 66f7fd99fa1d8c8e3b09fadd5624db9968b67506 (patch) | |
tree | 823985fa137d154aa4557767f97f47d54191a954 /src/gallium/tests/trivial/quad-tex.c | |
parent | 317be33d73228fe8b340de8e029ff24b6e0d95b5 (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/quad-tex.c')
-rw-r--r-- | src/gallium/tests/trivial/quad-tex.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c index cc19e8d5eec..7caac29299f 100644 --- a/src/gallium/tests/trivial/quad-tex.c +++ b/src/gallium/tests/trivial/quad-tex.c @@ -57,16 +57,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; @@ -93,10 +89,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); @@ -298,6 +299,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); } |