diff options
author | Nicolai Hähnle <[email protected]> | 2019-04-24 15:52:35 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-07-03 15:51:12 -0400 |
commit | 064f195ef01fbcd0cf49b32cb48cc03b91470527 (patch) | |
tree | 768a36e89ecbbb98d03d88975add91f9a224b747 | |
parent | 04e27ec136e454700f395565a91a35035cce56dd (diff) |
radeonsi: make si_restore_qbo_state externally available
Acked-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_query.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 13 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.h | 1 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/gallium/drivers/radeonsi/si_query.c b/src/gallium/drivers/radeonsi/si_query.c index a2b5937d69f..fabb7544047 100644 --- a/src/gallium/drivers/radeonsi/si_query.c +++ b/src/gallium/drivers/radeonsi/si_query.c @@ -1461,20 +1461,6 @@ bool si_query_hw_get_result(struct si_context *sctx, return true; } -static 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_query_hw_get_result_resource(struct si_context *sctx, struct si_query *squery, bool wait, 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; diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index 761e61899b1..d1fc1c09c66 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -557,6 +557,7 @@ si_create_sampler_view_custom(struct pipe_context *ctx, void si_update_fb_dirtiness_after_rendering(struct si_context *sctx); void si_update_ps_iter_samples(struct si_context *sctx); 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); void si_set_occlusion_query_state(struct si_context *sctx, bool old_perfect_enable); |