radv/ac: handle emitting gs epilogue
authorDave Airlie <airlied@redhat.com>
Thu, 19 Jan 2017 04:47:50 +0000 (14:47 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 30 Jan 2017 23:29:48 +0000 (09:29 +1000)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 6e97ae3322a22405e7368745b39592d059c43df2..f046badc60b7b3c1acfe76dc9d9ae550caa52713 100644 (file)
@@ -4465,6 +4465,17 @@ handle_fs_outputs_post(struct nir_to_llvm_context *ctx)
        ctx->shader_info->fs.output_mask = index ? ((1ull << index) - 1) : 0;
 }
 
+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)
 {
@@ -4475,6 +4486,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;
        }