diff options
author | Bruce Cherniak <[email protected]> | 2016-12-12 19:24:59 -0600 |
---|---|---|
committer | Tim Rowley <[email protected]> | 2016-12-16 11:29:02 -0600 |
commit | 79b66ec05e2745e5d19838dcfd83f905afa82b6c (patch) | |
tree | 5893ed8d0e3dc45248e2a4b14be64f91ec33b753 /src/gallium/drivers/swr/swr_state.cpp | |
parent | 3421b3f5a35f5cf29934f74c30850c4d04ba0237 (diff) |
swr: Implement fence attached work queues for deferred deletion.
Work can now be added to fences and triggered by fence completion. This
allows for deferred resource deletion, and other asynchronous tasks.
Reviewed-by: George Kyriazis <[email protected]>
Diffstat (limited to 'src/gallium/drivers/swr/swr_state.cpp')
-rw-r--r-- | src/gallium/drivers/swr/swr_state.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp index 4475252e50e..41e03560b17 100644 --- a/src/gallium/drivers/swr/swr_state.cpp +++ b/src/gallium/drivers/swr/swr_state.cpp @@ -372,10 +372,9 @@ swr_delete_vs_state(struct pipe_context *pipe, void *vs) struct swr_vertex_shader *swr_vs = (swr_vertex_shader *)vs; FREE((void *)swr_vs->pipe.tokens); struct swr_screen *screen = swr_screen(pipe->screen); - if (!swr_is_fence_pending(screen->flush_fence)) - swr_fence_submit(swr_context(pipe), screen->flush_fence); - swr_fence_finish(pipe->screen, NULL, screen->flush_fence, 0); - delete swr_vs; + + /* Defer deletion of vs state */ + swr_fence_work_delete_vs(screen->flush_fence, swr_vs); } static void * @@ -412,10 +411,9 @@ swr_delete_fs_state(struct pipe_context *pipe, void *fs) struct swr_fragment_shader *swr_fs = (swr_fragment_shader *)fs; FREE((void *)swr_fs->pipe.tokens); struct swr_screen *screen = swr_screen(pipe->screen); - if (!swr_is_fence_pending(screen->flush_fence)) - swr_fence_submit(swr_context(pipe), screen->flush_fence); - swr_fence_finish(pipe->screen, NULL, screen->flush_fence, 0); - delete swr_fs; + + /* Defer deleton of fs state */ + swr_fence_work_delete_fs(screen->flush_fence, swr_fs); } @@ -912,7 +910,7 @@ swr_update_derived(struct pipe_context *pipe, const struct pipe_draw_info *p_draw_info) { struct swr_context *ctx = swr_context(pipe); - struct swr_screen *screen = swr_screen(ctx->pipe.screen); + struct swr_screen *screen = swr_screen(pipe->screen); /* Update screen->pipe to current pipe context. */ if (screen->pipe != pipe) |