llvmpipe: allow vertex processing and fragment processing in parallel

This removes the block at the end of fragment processing and allow
multiple scenes to be queued to the rasterizer up to MAX_SCENES.

Running heaven with this shows up to 39 scenes been allocated in the
first few renders, but it also removes all stalls in rendering until
the present stalls for completion. It reduces frame rendering times
(not enough to make it > 1 fps) but looks to be about 10% increase.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
This commit is contained in:
Dave Airlie 2020-03-31 16:02:08 +10:00 committed by Marge Bot
parent 0dccec8e89
commit ec8104c6b2
4 changed files with 5 additions and 18 deletions

View File

@ -81,8 +81,6 @@ lp_rast_begin( struct lp_rasterizer *rast,
static void
lp_rast_end( struct lp_rasterizer *rast )
{
lp_scene_end_rasterization( rast->curr_scene );
rast->curr_scene = NULL;
}

View File

@ -100,7 +100,7 @@ lp_scene_create( struct lp_setup_context *setup )
void
lp_scene_destroy(struct lp_scene *scene)
{
lp_fence_reference(&scene->fence, NULL);
lp_scene_end_rasterization(scene);
mtx_destroy(&scene->mutex);
assert(scene->data.head == &scene->data.first);
slab_free_st(&scene->setup->scene_slab, scene);

View File

@ -73,6 +73,7 @@ lp_setup_wait_empty_scene(struct lp_setup_context *setup)
debug_printf("%s: wait for scene %d\n",
__FUNCTION__, setup->scenes[0]->fence->id);
lp_fence_wait(setup->scenes[0]->fence);
lp_scene_end_rasterization(setup->scenes[0]);
}
return 0;
}
@ -86,8 +87,10 @@ lp_setup_get_empty_scene(struct lp_setup_context *setup)
/* try and find a scene that isn't being used */
for (i = 0; i < setup->num_active_scenes; i++) {
if (setup->scenes[i]->fence) {
if (lp_fence_signalled(setup->scene->fence))
if (lp_fence_signalled(setup->scenes[i]->fence)) {
lp_scene_end_rasterization(setup->scenes[i]);
break;
}
} else
break;
}
@ -210,22 +213,9 @@ lp_setup_rasterize_scene( struct lp_setup_context *setup )
setup->last_fence->issued = TRUE;
mtx_lock(&screen->rast_mutex);
/* FIXME: We enqueue the scene then wait on the rasterizer to finish.
* This means we never actually run any vertex stuff in parallel to
* rasterization (not in the same context at least) which is what the
* multiple scenes per setup is about - when we get a new empty scene
* any old one is already empty again because we waited here for
* raster tasks to be finished. Ideally, we shouldn't need to wait here
* and rely on fences elsewhere when waiting is necessary.
* Certainly, lp_scene_end_rasterization() would need to be deferred too
* and there's probably other bits why this doesn't actually work.
*/
lp_rast_queue_scene(screen->rast, scene);
lp_rast_finish(screen->rast);
mtx_unlock(&screen->rast_mutex);
lp_scene_end_rasterization(setup->scene);
lp_setup_reset( setup );
LP_DBG(DEBUG_SETUP, "%s done \n", __FUNCTION__);

View File

@ -56,7 +56,6 @@ struct lp_setup_variant;
/** Max number of scenes */
/* XXX: make multiple scenes per context work, see lp_setup_rasterize_scene */
#define INITIAL_SCENES 4
#define MAX_SCENES 64