diff options
author | Marek Olšák <[email protected]> | 2020-01-03 16:20:40 -0500 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-01-20 16:16:11 -0500 |
commit | 5a0fcf11f0d82f0bd20cd15addfa8086d715c16b (patch) | |
tree | 83eafe7cb5377dedc3114bb3d458bf9b2979d9d9 /src/gallium/drivers/radeonsi | |
parent | cf9f8d1ea2044effc35e15e1ee91a528b8d9e487 (diff) |
radeonsi/gfx10: move s_sendmsg gs_alloc_req to the beginning of shaders
This will allow us to merge some IF blocks in shaders.
Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r-- | src/gallium/drivers/radeonsi/gfx10_shader_ngg.c | 10 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_internal.h | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c index b7b7edc46e7..2f6f9fe3cc2 100644 --- a/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c +++ b/src/gallium/drivers/radeonsi/gfx10_shader_ngg.c @@ -123,6 +123,13 @@ static LLVMValueRef ngg_get_vertices_per_prim(struct si_shader_context *ctx, } } +void gfx10_ngg_build_sendmsg_gs_alloc_req(struct si_shader_context *ctx) +{ + ac_build_sendmsg_gs_alloc_req(&ctx->ac, get_wave_id_in_tg(ctx), + ngg_get_vtx_cnt(ctx), + ngg_get_prim_cnt(ctx)); +} + static void build_streamout_vertex(struct si_shader_context *ctx, LLVMValueRef *so_buffer, LLVMValueRef *wg_offset_dw, unsigned stream, LLVMValueRef offset_vtx, @@ -646,9 +653,6 @@ void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi, ac_build_endif(&ctx->ac, 5400); } - ac_build_sendmsg_gs_alloc_req(&ctx->ac, get_wave_id_in_tg(ctx), - ngg_get_vtx_cnt(ctx), ngg_get_prim_cnt(ctx)); - /* Update query buffer */ if (ctx->screen->use_ngg_streamout && !info->properties[TGSI_PROPERTY_VS_BLIT_SGPRS_AMD]) { diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 766d25b396e..592a486424a 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2421,6 +2421,11 @@ static bool si_build_main_function(struct si_shader_context *ctx, (shader->key.as_ngg && !shader->key.as_es))) ac_init_exec_full_mask(&ctx->ac); + if ((ctx->type == PIPE_SHADER_VERTEX || + ctx->type == PIPE_SHADER_TESS_EVAL) && + shader->key.as_ngg && !shader->key.as_es) + gfx10_ngg_build_sendmsg_gs_alloc_req(ctx); + if (ctx->type == PIPE_SHADER_TESS_CTRL || ctx->type == PIPE_SHADER_GEOMETRY) { if (ctx->type == PIPE_SHADER_GEOMETRY && shader->key.as_ngg) { diff --git a/src/gallium/drivers/radeonsi/si_shader_internal.h b/src/gallium/drivers/radeonsi/si_shader_internal.h index 80011edb3d5..b8d2ac84fca 100644 --- a/src/gallium/drivers/radeonsi/si_shader_internal.h +++ b/src/gallium/drivers/radeonsi/si_shader_internal.h @@ -299,6 +299,7 @@ void si_llvm_emit_streamout(struct si_shader_context *ctx, unsigned noutput, unsigned stream); void si_create_function(struct si_shader_context *ctx); +void gfx10_ngg_build_sendmsg_gs_alloc_req(struct si_shader_context *ctx); void gfx10_emit_ngg_epilogue(struct ac_shader_abi *abi, unsigned max_outputs, LLVMValueRef *addrs); |