diff options
author | Erik Faye-Lund <[email protected]> | 2019-05-07 12:13:43 +0200 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-07-17 10:43:06 +0000 |
commit | d59c961af9eb48b61c0e078a71b3e8ca95a06778 (patch) | |
tree | e36df1e1747111fd3dbef3bc35b60e36a9d6025d /src/gallium/drivers/softpipe | |
parent | 5a8496007202f065efb3734e5925717268efc226 (diff) |
softpipe: pass stream-out targets to draw-module early
This is essensially a port of ed53e61bec9 from LLVMpipe to softpipe,
as it makes things a bit simpler and more performant.
Signed-off-by: Erik Faye-Lund <[email protected]>
Reviewed-By: Gert Wollny <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_draw_arrays.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_so.c | 9 |
2 files changed, 8 insertions, 15 deletions
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index 6363701cf92..91427348a25 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -109,18 +109,6 @@ softpipe_draw_vbo(struct pipe_context *pipe, info->index_size, available_space); } - - for (i = 0; i < sp->num_so_targets; i++) { - void *buf = 0; - if (sp->so_targets[i]) { - buf = softpipe_resource(sp->so_targets[i]->target.buffer)->data; - sp->so_targets[i]->mapping = buf; - } - } - - draw_set_mapped_so_targets(draw, sp->num_so_targets, - sp->so_targets); - if (softpipe_screen(sp->pipe.screen)->use_llvm) { softpipe_prepare_vertex_sampling(sp, sp->num_sampler_views[PIPE_SHADER_VERTEX], @@ -151,8 +139,6 @@ softpipe_draw_vbo(struct pipe_context *pipe, draw_set_indexes(draw, NULL, 0, 0); } - draw_set_mapped_so_targets(draw, 0, NULL); - if (softpipe_screen(sp->pipe.screen)->use_llvm) { softpipe_cleanup_vertex_sampling(sp); softpipe_cleanup_geometry_sampling(sp); diff --git a/src/gallium/drivers/softpipe/sp_state_so.c b/src/gallium/drivers/softpipe/sp_state_so.c index 3878e4a5389..aa2f11880dd 100644 --- a/src/gallium/drivers/softpipe/sp_state_so.c +++ b/src/gallium/drivers/softpipe/sp_state_so.c @@ -70,6 +70,11 @@ softpipe_set_so_targets(struct pipe_context *pipe, for (i = 0; i < num_targets; i++) { pipe_so_target_reference((struct pipe_stream_output_target **)&softpipe->so_targets[i], targets[i]); + + if (targets[i]) { + void *buf = softpipe_resource(targets[i]->buffer)->data; + softpipe->so_targets[i]->mapping = buf; + } } for (; i < softpipe->num_so_targets; i++) { @@ -77,6 +82,9 @@ softpipe_set_so_targets(struct pipe_context *pipe, } softpipe->num_so_targets = num_targets; + + draw_set_mapped_so_targets(softpipe->draw, softpipe->num_so_targets, + softpipe->so_targets); } void @@ -86,4 +94,3 @@ softpipe_init_streamout_funcs(struct pipe_context *pipe) pipe->stream_output_target_destroy = softpipe_so_target_destroy; pipe->set_stream_output_targets = softpipe_set_so_targets; } - |