softpipe: pass stream-out targets to draw-module early
This is essensially a port of ed53e61bec
from LLVMpipe to softpipe,
as it makes things a bit simpler and more performant.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
This commit is contained in:
parent
5a84960072
commit
d59c961af9
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue