[Mesa-dev] [PATCH 15/29] radv/ac: handle emitting gs epilogue

Dave Airlie airlied at gmail.com
Mon Jan 30 06:02:49 UTC 2017


From: Dave Airlie <airlied at redhat.com>

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/common/ac_nir_to_llvm.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 592ee99..664c5c4 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -4457,6 +4457,17 @@ handle_fs_outputs_post(struct nir_to_llvm_context *ctx)
 }
 
 static void
+emit_gs_epilogue(struct nir_to_llvm_context *ctx)
+{
+	LLVMValueRef args[2];
+
+	args[0] = LLVMConstInt(ctx->i32, SENDMSG_GS_OP_NOP | SENDMSG_GS_DONE, false);
+	args[1] = ctx->gs_wave_id;
+	ac_emit_llvm_intrinsic(&ctx->ac, "llvm.SI.sendmsg",
+			       ctx->voidt, args, 2, 0);
+}
+
+static void
 handle_shader_outputs_post(struct nir_to_llvm_context *ctx)
 {
 	switch (ctx->stage) {
@@ -4466,6 +4477,9 @@ handle_shader_outputs_post(struct nir_to_llvm_context *ctx)
 	case MESA_SHADER_FRAGMENT:
 		handle_fs_outputs_post(ctx);
 		break;
+	case MESA_SHADER_GEOMETRY:
+		emit_gs_epilogue(ctx);
+		break;
 	default:
 		break;
 	}
-- 
2.9.3



More information about the mesa-dev mailing list