radeonsi: make si_restore_qbo_state externally available
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 24 Apr 2019 13:52:35 +0000 (15:52 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 3 Jul 2019 19:51:12 +0000 (15:51 -0400)
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/gallium/drivers/radeonsi/si_query.c
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state.h

index a2b5937d69f295e4ae87724ef92f5834d78c30bc..fabb75440475bb359bc61712fbe6b3dc99e59980 100644 (file)
@@ -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,
index 77ecf08565dee0679688155c8d848818b5b2e50b..143783d4c873dccc26a9c3ab5fe7e7ed24a18749 100644 (file)
@@ -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;
index 761e61899b1950fa2ad7f607c74dddab469f56c1..d1fc1c09c66cd11ad44090b6df0bc58c6ffaeb8f 100644 (file)
@@ -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);