aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state.c
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2019-04-24 15:52:35 +0200
committerMarek Olšák <[email protected]>2019-07-03 15:51:12 -0400
commit064f195ef01fbcd0cf49b32cb48cc03b91470527 (patch)
tree768a36e89ecbbb98d03d88975add91f9a224b747 /src/gallium/drivers/radeonsi/si_state.c
parent04e27ec136e454700f395565a91a35035cce56dd (diff)
radeonsi: make si_restore_qbo_state externally available
Acked-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 77ecf08565d..143783d4c87 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1371,6 +1371,19 @@ void si_save_qbo_state(struct si_context *sctx, struct si_qbo_state *st)
}
}
+void si_restore_qbo_state(struct si_context *sctx, struct si_qbo_state *st)
+{
+ sctx->b.bind_compute_state(&sctx->b, st->saved_compute);
+
+ sctx->b.set_constant_buffer(&sctx->b, PIPE_SHADER_COMPUTE, 0, &st->saved_const0);
+ pipe_resource_reference(&st->saved_const0.buffer, NULL);
+
+ sctx->b.set_shader_buffers(&sctx->b, PIPE_SHADER_COMPUTE, 0, 3, st->saved_ssbo,
+ st->saved_ssbo_writable_mask);
+ for (unsigned i = 0; i < 3; ++i)
+ pipe_resource_reference(&st->saved_ssbo[i].buffer, NULL);
+}
+
static void si_emit_db_render_state(struct si_context *sctx)
{
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;