diff options
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/target-helpers/inline_debug_helper.h | 4 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_tests.c | 9 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_tests.h | 4 |
3 files changed, 14 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/target-helpers/inline_debug_helper.h b/src/gallium/auxiliary/target-helpers/inline_debug_helper.h index 6fe667d3fbd..faae1800e72 100644 --- a/src/gallium/auxiliary/target-helpers/inline_debug_helper.h +++ b/src/gallium/auxiliary/target-helpers/inline_debug_helper.h @@ -4,6 +4,7 @@ #include "pipe/p_compiler.h" #include "util/u_debug.h" +#include "util/u_tests.h" /* Helper function to wrap a screen with @@ -49,6 +50,9 @@ debug_screen_wrap(struct pipe_screen *screen) screen = noop_screen_create(screen); #endif + if (debug_get_bool_option("GALLIUM_TESTS", FALSE)) + util_run_tests(screen); + return screen; } diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c index b42f5e137ba..764c4c31944 100644 --- a/src/gallium/auxiliary/util/u_tests.c +++ b/src/gallium/auxiliary/util/u_tests.c @@ -261,7 +261,14 @@ tgsi_vs_window_space_position(struct pipe_context *ctx) * context_create. */ void -util_run_tests(struct pipe_context *ctx) +util_run_tests(struct pipe_screen *screen) { + struct pipe_context *ctx = screen->context_create(screen, NULL); + tgsi_vs_window_space_position(ctx); + + ctx->destroy(ctx); + + puts("Done. Exiting.."); + exit(0); } diff --git a/src/gallium/auxiliary/util/u_tests.h b/src/gallium/auxiliary/util/u_tests.h index a1439347d27..49ae54f876b 100644 --- a/src/gallium/auxiliary/util/u_tests.h +++ b/src/gallium/auxiliary/util/u_tests.h @@ -30,8 +30,8 @@ #include "pipe/p_compiler.h" -struct pipe_context; +struct pipe_screen; -void util_run_tests(struct pipe_context *ctx); +void util_run_tests(struct pipe_screen *screen); #endif |