Mesa (master): radeonsi/gfx10: move s_sendmsg gs_alloc_req to the beginning of shaders
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jan 20 21:33:28 UTC 2020
Module: Mesa
Branch: master
Commit: 5a0fcf11f0d82f0bd20cd15addfa8086d715c16b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a0fcf11f0d82f0bd20cd15addfa8086d715c16b
Author: Marek Olšák <marek.olsak at amd.com>
Date: Fri Jan 3 16:20:40 2020 -0500
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 <pierre-eric.pelloux-prayer at amd.com>
---
src/gallium/drivers/radeonsi/gfx10_shader_ngg.c | 10 +++++++---
src/gallium/drivers/radeonsi/si_shader.c | 5 +++++
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);
More information about the mesa-commit
mailing list