diff options
author | Marek Olšák <[email protected]> | 2018-08-15 21:36:14 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-05-16 13:06:51 -0400 |
commit | 49a016ec5d77e8401556bbd8cad386457537eb30 (patch) | |
tree | 22f8ffc6d836c94e6a698f538d9d99177161e1ca | |
parent | c44c6951d46a8e19c8764711d4c3d7a331822c9f (diff) |
radeonsi: make si_initialize_compute reusable
Tested-by: Dieter Nützel <[email protected]>
Acked-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_compute.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c index cf9c0601fc9..2d70f0759bb 100644 --- a/src/gallium/drivers/radeonsi/si_compute.c +++ b/src/gallium/drivers/radeonsi/si_compute.c @@ -317,9 +317,8 @@ static void si_set_global_binding( } } -static void si_initialize_compute(struct si_context *sctx) +void si_emit_initial_compute_regs(struct si_context *sctx, struct radeon_cmdbuf *cs) { - struct radeon_cmdbuf *cs = sctx->gfx_cs; uint64_t bc_va; radeon_set_sh_reg_seq(cs, R_00B858_COMPUTE_STATIC_THREAD_MGMT_SE0, 2); @@ -363,9 +362,6 @@ static void si_initialize_compute(struct si_context *sctx) bc_va >> 8); } } - - sctx->cs_shader_state.emitted_program = NULL; - sctx->cs_shader_state.initialized = true; } static bool si_setup_compute_scratch_buffer(struct si_context *sctx, @@ -914,8 +910,12 @@ static void si_launch_grid( if (sctx->bo_list_add_all_compute_resources) si_compute_resources_add_all_to_bo_list(sctx); - if (!sctx->cs_shader_state.initialized) - si_initialize_compute(sctx); + if (!sctx->cs_shader_state.initialized) { + si_emit_initial_compute_regs(sctx, sctx->gfx_cs); + + sctx->cs_shader_state.emitted_program = NULL; + sctx->cs_shader_state.initialized = true; + } if (sctx->flags) si_emit_cache_flush(sctx); diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index be7ca4d5f5c..f65f4f50043 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -1304,6 +1304,7 @@ unsigned si_end_counter(struct si_screen *sscreen, unsigned type, uint64_t begin); /* si_compute.c */ +void si_emit_initial_compute_regs(struct si_context *sctx, struct radeon_cmdbuf *cs); unsigned si_get_compute_resource_limits(struct si_screen *sscreen, unsigned waves_per_threadgroup, unsigned max_waves_per_sh); |