aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_state_so.c
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-05-06 15:35:04 +0200
committerErik Faye-Lund <[email protected]>2019-05-06 22:42:37 +0200
commited53e61bec9e926b60ede093d4dd2bac56a4c605 (patch)
tree88530417c073ed409db6b13b0e67702c21d165f7 /src/gallium/drivers/llvmpipe/lp_state_so.c
parentfc7649c4b77bf2786332516b57b694825c73db53 (diff)
llvmpipe: pass stream-out targets to draw-module early
We currently set this state in the draw-module twice on each draw, but which trashes this state. So far that's not a problem, because we don't really do much from that function. But it turns out, we're going to have to do more; namely flush when the state changes. This will incur a large performance penalty due to the excessive setting. Instead, let's rely on the CSO caching making sure that llvmpipe_set_so_targets doesn't get called needlessly, and setup the state directly there instead. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_so.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_so.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_so.c b/src/gallium/drivers/llvmpipe/lp_state_so.c
index b2afd6fbf70..0fd38c17e50 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_so.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_so.c
@@ -85,12 +85,20 @@ llvmpipe_set_so_targets(struct pipe_context *pipe,
if (!append && llvmpipe->so_targets[i]) {
llvmpipe->so_targets[i]->internal_offset = offsets[i];
}
+
+ if (targets[i]) {
+ void *buf = llvmpipe_resource(targets[i]->buffer)->data;
+ llvmpipe->so_targets[i]->mapping = buf;
+ }
}
for (; i < llvmpipe->num_so_targets; i++) {
pipe_so_target_reference((struct pipe_stream_output_target **)&llvmpipe->so_targets[i], NULL);
}
llvmpipe->num_so_targets = num_targets;
+
+ draw_set_mapped_so_targets(llvmpipe->draw, llvmpipe->num_so_targets,
+ llvmpipe->so_targets);
}
void