diff options
author | José Fonseca <[email protected]> | 2010-04-24 16:13:04 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2010-04-24 16:13:04 +0100 |
commit | bd6e9e33501ad4351029d0eb0efa6b83f9f05445 (patch) | |
tree | 42d568043dd645f9751d8154c8905c105529f88d | |
parent | 39be50dcdebe6bcbb48cb6aa8ac151eee811acb1 (diff) |
llvmpipe: Don't use fences when not using threads.
lp_setup_flush has effect immediately.
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 0dad4c259ec..194f628bef5 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -343,20 +343,25 @@ lp_setup_clear( struct lp_setup_context *setup, struct pipe_fence_handle * lp_setup_fence( struct lp_setup_context *setup ) { - struct lp_scene *scene = lp_setup_get_current_scene(setup); - const unsigned rank = lp_scene_get_num_bins( scene ); /* xxx */ - struct lp_fence *fence = lp_fence_create(rank); + if (setup->num_threads == 0) { + return NULL; + } + else { + struct lp_scene *scene = lp_setup_get_current_scene(setup); + const unsigned rank = lp_scene_get_num_bins( scene ); /* xxx */ + struct lp_fence *fence = lp_fence_create(rank); - LP_DBG(DEBUG_SETUP, "%s rank %u\n", __FUNCTION__, rank); + LP_DBG(DEBUG_SETUP, "%s rank %u\n", __FUNCTION__, rank); - set_scene_state( setup, SETUP_ACTIVE ); + set_scene_state( setup, SETUP_ACTIVE ); - /* insert the fence into all command bins */ - lp_scene_bin_everywhere( scene, - lp_rast_fence, - lp_rast_arg_fence(fence) ); + /* insert the fence into all command bins */ + lp_scene_bin_everywhere( scene, + lp_rast_fence, + lp_rast_arg_fence(fence) ); - return (struct pipe_fence_handle *) fence; + return (struct pipe_fence_handle *) fence; + } } |